Initialize Article Data Manager project
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
from article_data_manager.validation.numbers import parse_decimal
|
||||
|
||||
|
||||
def test_parse_decimal_accepts_comma_decimal() -> None:
|
||||
assert parse_decimal("6,00") == 6.0
|
||||
|
||||
|
||||
def test_parse_decimal_accepts_point_decimal() -> None:
|
||||
assert parse_decimal("1.20") == 1.2
|
||||
|
||||
|
||||
def test_parse_decimal_maps_empty_value_to_none() -> None:
|
||||
assert parse_decimal("") is None
|
||||
|
||||
|
||||
def test_parse_decimal_rejects_ambiguous_number() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
parse_decimal("1.234,56")
|
||||
Reference in New Issue
Block a user