Skip to content

Commit 30b0263

Browse files
committed
Added test for datetime string with timezone
1 parent 6158d8a commit 30b0263

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/test_transform.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def test_datetime_transform(self):
6767
trans.integer_datetime_fmt = UNIX_SECONDS_INTEGER_DATETIME_PARSING
6868
self.assertIsNone(trans._transform_datetime('cat'))
6969

70+
def test_datetime_string_with_timezone(self):
71+
schema = {"type": "string", "format": "date-time"}
72+
string_datetime = "2017-03-18T07:00:05-0700"
73+
transformed_string_datetime = "2017-03-18T14:00:05.000000Z"
74+
self.assertEqual(transformed_string_datetime, transform(string_datetime, schema))
75+
7076
def test_datetime_fractional_seconds_transform(self):
7177
schema = {"type": "string", "format": "date-time"}
7278
string_datetime = "2017-01-01T00:00:00.123000Z"

0 commit comments

Comments
 (0)