aboutsummaryrefslogtreecommitdiff
path: root/test/test_digikey.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_digikey.py')
-rw-r--r--test/test_digikey.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_digikey.py b/test/test_digikey.py
index ccdc083..2e9b1f1 100644
--- a/test/test_digikey.py
+++ b/test/test_digikey.py
@@ -5,6 +5,7 @@ from pathlib import Path
import pytest
import ee.digikey as dk
+from ee.money import Money
basedir = Path(__file__).parent
static_copies = basedir / "digikey" / "static-copies" # type: Path
@@ -26,6 +27,10 @@ def test_digikey_1(tmpdir):
assert p.mpn == "TCR2LF18,LM(CT"
assert len(p.attributes) > 5
+ assert len(p.price_breaks) == 6
+ assert p.price_breaks[0].quantity == 3000
+ assert p.price_breaks[0].price == Money("USD 0.07")
+
repo = dk.DigikeyRepository(digikey, str(tmpdir))
x = io.StringIO()
p.to_ini(repo._make_configparser()).write(x)
@@ -78,4 +83,3 @@ def test_digikey_3():
p = next((p for p in res.products if p.part_number == "1655-1501-1-ND"), None)
assert p.mpn == "RS1MTR"
assert p.url == "/product-detail/en/smc-diode-solutions/RS1MTR/1655-1501-1-ND/6022946"
-