34 lines
820 B
Python
34 lines
820 B
Python
"""
|
|
Tests pour le parsing de prix avec separateurs de milliers.
|
|
"""
|
|
|
|
from pricewatch.app.stores.price_parser import parse_price_text
|
|
|
|
|
|
def test_parse_price_with_thousands_space():
|
|
assert parse_price_text("1 259,00") == 1259.00
|
|
|
|
|
|
def test_parse_price_with_narrow_nbsp():
|
|
assert parse_price_text("1\u202f259,00") == 1259.00
|
|
|
|
|
|
def test_parse_price_with_dot_thousands():
|
|
assert parse_price_text("1.259,00") == 1259.00
|
|
|
|
|
|
def test_parse_price_with_comma_thousands():
|
|
assert parse_price_text("1,259.00") == 1259.00
|
|
|
|
|
|
def test_parse_price_without_decimal():
|
|
assert parse_price_text("1259") == 1259.00
|
|
|
|
|
|
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
|