before claude
This commit is contained in:
BIN
tests/stores/__pycache__/test_cdiscount_fixtures.cpython-313-pytest-9.0.2.pyc
Executable file → Normal file
BIN
tests/stores/__pycache__/test_cdiscount_fixtures.cpython-313-pytest-9.0.2.pyc
Executable file → Normal file
Binary file not shown.
Binary file not shown.
@@ -171,7 +171,25 @@ class TestCdiscountRealFixtures:
|
||||
assert isinstance(snapshot.price, float)
|
||||
assert snapshot.price > 0
|
||||
# Le prix doit avoir maximum 2 décimales
|
||||
assert snapshot.price == round(snapshot.price, 2)
|
||||
assert snapshot.price == round(snapshot.price, 2)
|
||||
|
||||
def test_parse_tuf608umrv004_price_value(self, store, fixture_tuf608umrv004):
|
||||
"""Le prix doit correspondre à 1199,99 €."""
|
||||
url = "https://www.cdiscount.com/informatique/.../f-10709-tuf608umrv004.html"
|
||||
snapshot = store.parse(fixture_tuf608umrv004, url)
|
||||
assert snapshot.price == 1199.99
|
||||
|
||||
def test_parse_tuf608umrv004_category_and_msrp(
|
||||
self, store, fixture_tuf608umrv004
|
||||
):
|
||||
"""La fixture ASUS doit fournir une catégorie et un prix conseillé."""
|
||||
url = "https://www.cdiscount.com/informatique/.../f-10709-tuf608umrv004.html"
|
||||
snapshot = store.parse(fixture_tuf608umrv004, url)
|
||||
assert snapshot.category
|
||||
assert "Ordinateur" in snapshot.category or "Portable" in snapshot.category
|
||||
assert snapshot.msrp is not None
|
||||
if snapshot.price:
|
||||
assert snapshot.msrp >= snapshot.price
|
||||
|
||||
def test_parse_a128902_price_format(self, store, fixture_a128902):
|
||||
"""Parse fixture a128902 - le prix doit être un float valide."""
|
||||
|
||||
@@ -27,3 +27,7 @@ def test_parse_price_without_decimal():
|
||||
|
||||
def test_parse_price_with_currency():
|
||||
assert parse_price_text("EUR 1 259,00") == 1259.00
|
||||
|
||||
|
||||
def test_parse_price_with_cents_after_currency_symbol():
|
||||
assert parse_price_text("1199 €99") == 1199.99
|
||||
|
||||
Reference in New Issue
Block a user