abstracted out bounded cycles
This commit is contained in:
1 parent
aa6ed4cb06
commit
8903be2685
3 files changed
+229
-3
No files matched your search
@@ -30,6 +30,9 @@ def _doc(**overrides) -> dict:
|
||||
"endDate": None,
|
||||
"priceBeforeDrop": None,
|
||||
"eduPrice": None,
|
||||
"pastPrices": [
|
||||
{"price": 80.0, "date": datetime(2026, 7, 26, tzinfo=timezone.utc)}
|
||||
],
|
||||
"available": True,
|
||||
"condition": None,
|
||||
"appExclusive": None,
|
||||
@@ -103,3 +106,19 @@ def test_dollar_code_does_not_affect_threshold():
|
||||
promoMinSpend=100,
|
||||
)
|
||||
assert build_product_details(doc, min_percentage=40) is None
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- pastPrices
|
||||
|
||||
|
||||
def test_past_prices_read_through():
|
||||
"""Price history passes through unchanged."""
|
||||
|
||||
history = [
|
||||
{"price": 95.0, "date": datetime(2026, 7, 20, tzinfo=timezone.utc)},
|
||||
{"price": 90.0, "date": datetime(2026, 7, 24, tzinfo=timezone.utc)},
|
||||
]
|
||||
|
||||
product = build_product_details(_doc(pastPrices=history), min_percentage=0)
|
||||
|
||||
assert product.pricing.past_prices == history
|
||||
Reference in new issue
Block a user