1er
This commit is contained in:
16
backend/app/tests/test_normalize.py
Normal file
16
backend/app/tests/test_normalize.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from backend.app.scraper.normalize import parse_price_fr, parse_rating_count, parse_rating_value
|
||||
|
||||
|
||||
def test_parse_price_fr():
|
||||
assert parse_price_fr("1 249,99 €") == 1249.99
|
||||
assert parse_price_fr("249,99") == 249.99
|
||||
|
||||
|
||||
def test_parse_rating_value():
|
||||
assert parse_rating_value("4,7 sur 5") == 4.7
|
||||
assert parse_rating_value("4.0") == 4.0
|
||||
|
||||
|
||||
def test_parse_rating_count():
|
||||
assert parse_rating_count("1 234 évaluations") == 1234
|
||||
assert parse_rating_count("987") == 987
|
||||
Reference in New Issue
Block a user