Files
hpoi/tests/test_utils.py
2025-05-21 16:21:03 +02:00

12 lines
374 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from hpoi.models.currency import Currency
from hpoi.utils import get_price_from_text
def test_get_price_from_text():
assert get_price_from_text("0人民币") == {}
assert get_price_from_text("9,400日元 含税465元") == {
Currency.CNY: 465,
Currency.JPY: 9400,
}
assert get_price_from_text("249人民币") == {Currency.CNY: 249}