before claude

This commit is contained in:
Gilles Soulier
2026-01-17 13:40:26 +01:00
parent d0b73b9319
commit cf7c415e22
35 changed files with 3411 additions and 221 deletions

Binary file not shown.

View File

@@ -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."""

View File

@@ -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