summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2018-01-16 00:33:36 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2018-01-16 00:33:36 +0200
commitcc519b72476f0bd03fd5087dc8be1b26c2cc3ed7 (patch)
tree83563334f980a43910d6f5881309df8f8a8d2541 /tests/test_util.py
parentc94428ef1e3cb67bc0400ae7d5ba5b8b5798e193 (diff)
downloadapscheduler-cron-dst-fix.tar.gz
Added support for UTC offsets in datetime parsingcron-dst-fix
Fixes #271.
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 55bf197..973b81a 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -107,9 +107,15 @@ class TestConvertToDatetime(object):
(datetime(2009, 8, 1, 5, 6, 12), datetime(2009, 8, 1, 5, 6, 12)),
('2009-8-1', datetime(2009, 8, 1)),
('2009-8-1 5:16:12', datetime(2009, 8, 1, 5, 16, 12)),
+ ('2009-8-1T5:16:12Z', datetime(2009, 8, 1, 5, 16, 12, tzinfo=pytz.utc)),
+ ('2009-8-1T5:16:12+02:30',
+ pytz.FixedOffset(150).localize(datetime(2009, 8, 1, 5, 16, 12))),
+ ('2009-8-1T5:16:12-05:30',
+ pytz.FixedOffset(-330).localize(datetime(2009, 8, 1, 5, 16, 12))),
(pytz.FixedOffset(-60).localize(datetime(2009, 8, 1)),
pytz.FixedOffset(-60).localize(datetime(2009, 8, 1)))
- ], ids=['None', 'date', 'datetime', 'date as text', 'datetime as text', 'existing tzinfo'])
+ ], ids=['None', 'date', 'datetime', 'date as text', 'datetime as text', 'utc', 'tzoffset',
+ 'negtzoffset', 'existing tzinfo'])
def test_date(self, timezone, input, expected):
returned = convert_to_datetime(input, timezone, None)
if expected is not None: