Skip to content

Commit

Permalink
Amend tests to catch datetime not formatted to ISO8601.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed Sep 29, 2023
1 parent 39fdbba commit 588195a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/tests_unit/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def test_datetime_string_replacement(self, key, underscore_position):
regex = re.compile(rf"{start}_time-\d\d\d\d\d\d_{end}")
elif key == tags("datetime"):
regex = re.compile(
rf"{start}_date-\d\d\d\d\d\d\d\d_time-\d\d\d\d\d\d_{end}"
rf"{start}_datetime-\d\d\d\d\d\d\d\dT\d\d\d\d\d\d_{end}" # TODO: can we use something like "[0-9]+" with a specific number?
)

name_list = [name]
formatting.update_names_with_datetime(name_list)

assert re.search(regex, name_list[0]) is not None
assert (
re.search(regex, name_list[0]) is not None
), "datetime formatting is incorrect."

@pytest.mark.parametrize(
"prefix_and_names",
Expand Down

0 comments on commit 588195a

Please sign in to comment.