@@ -45,18 +45,20 @@ def test_is_valid_datetime(self, _):
4545 """Tests that is_valid_datetime returns True for valid datetimes, and false otherwise"""
4646 # Test case tuples are structured as (date_time_string, expected_result)
4747 test_cases = [
48- ("20200101T12345600" , True ), # Valid datetime string with timezone
49- ("20200101T123456" , True ), # Valid datetime string without timezone
48+ ("20200101T12345600" , True ), # Valid datetime string with timezone offset "00" GMT
49+ ("20200101T12345601" , True ), # Valid datetime string with timezone offset "01" BST
50+ ("20200101T123456" , False ), # Invalid datetime string without timezone
5051 (
5152 "20200101T123456extracharacters" ,
52- True ,
53- ), # Valid datetime string with additional characters
53+ False ,
54+ ), # Invalid datetime string with additional characters
5455 ("20201301T12345600" , False ), # Invalid month
5556 ("20200100T12345600" , False ), # Invalid day
5657 ("20200230T12345600" , False ), # Invalid combination of month and day
5758 ("20200101T24345600" , False ), # Invalid hours
5859 ("20200101T12605600" , False ), # Invalid minutes
5960 ("20200101T12346000" , False ), # Invalid seconds
61+ ("20200101T12345609" , False ), # Invalid timezone offset
6062 ("2020010112345600" , False ), # Invalid missing the 'T'
6163 ("20200101T12345" , False ), # Invalid string too short
6264 ]
@@ -124,7 +126,7 @@ def test_validate_extended_attributes_file_key(self, mock_get_redis_client):
124126 ),
125127 # Valid extended attributes file key with different organization code
126128 (
127- "Vaccination_Extended_Attributes_v1_5_YGM41_20221231T23595999 .csv" ,
129+ "Vaccination_Extended_Attributes_v1_5_YGM41_20221231T23595900 .csv" ,
128130 "YGM41" ,
129131 ),
130132 ]
0 commit comments