Skip to content

Commit

Permalink
test identify_datetime_format
Browse files Browse the repository at this point in the history
to debug why test is not passed in CI but works locally
  • Loading branch information
polinaeterna committed Jan 10, 2025
1 parent 787ad3b commit 5163500
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/libcommon/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
get_datetime,
get_duration,
get_expires,
identify_datetime_format,
inputs_to_string,
is_image_url,
orjson_dumps,
Expand Down Expand Up @@ -153,3 +154,13 @@ def test_serialize_and_truncate_raises(obj: Any, max_bytes: int) -> None:

def test_get_duration() -> None:
assert get_duration(get_datetime() - timedelta(seconds=10)) == pytest.approx(10, rel=0.01)


@pytest.mark.parametrize(
"datetime_string,expected_format",
[
("2024-01-01 00:00:00CET", "%Y-%m-%d %H:%M:%S%Z"),
],
)
def test_identify_datetime_format(datetime_string: str, expected_format: str) -> None:
assert identify_datetime_format(datetime_string) == expected_format

0 comments on commit 5163500

Please sign in to comment.