refactor(data-extraction): Move date_to_iso function to string_tools

This commit is contained in:
TrisNol
2023-09-23 10:51:54 +02:00
parent 77f08cd901
commit 1e23a8d5a3
5 changed files with 33 additions and 31 deletions

View File

@@ -33,3 +33,15 @@ def test_simplify_string_type_error(value: Any) -> None:
"""Tests if the type error is thrown when the value is the wrong type."""
with pytest.raises(TypeError):
assert string_tools.simplify_string(value)
@pytest.mark.parametrize(
("value", "expected"),
[
("10.10.1111", "1111-10-10"),
("10.10.98", "1998-10-10"),
],
)
def test_transform_date_to_iso(value: str, expected: str) -> None:
result = string_tools.transform_date_to_iso(value)
assert result == expected