summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Morega <alex@grep.ro>2014-01-06 21:55:27 +0200
committerAlex Morega <alex@grep.ro>2014-01-06 21:55:49 +0200
commit88c564228d30a6cda6368cf2077341fea0c6c6d2 (patch)
treed7591c58d2c234f776372cb74b64aeb7a4c53905 /tests
parent1df64dfe5d9e10f6725362d467278c5eb02e5162 (diff)
downloadbabel-88c564228d30a6cda6368cf2077341fea0c6c6d2.tar.gz
parse datetime values with no timezone info
fixes #56
Diffstat (limited to 'tests')
-rw-r--r--tests/messages/test_catalog.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/messages/test_catalog.py b/tests/messages/test_catalog.py
index fcac34d..aac71ee 100644
--- a/tests/messages/test_catalog.py
+++ b/tests/messages/test_catalog.py
@@ -454,3 +454,17 @@ def test_catalog_update():
assert not 'head' in cat
assert list(cat.obsolete.values())[0].id == 'head'
+
+
+def test_datetime_parsing():
+ val1 = catalog._parse_datetime_header('2006-06-28 23:24+0200')
+ assert val1.year == 2006
+ assert val1.month == 6
+ assert val1.day == 28
+ assert val1.tzinfo.zone == 'Etc/GMT+120'
+
+ val2 = catalog._parse_datetime_header('2006-06-28 23:24')
+ assert val2.year == 2006
+ assert val2.month == 6
+ assert val2.day == 28
+ assert val2.tzinfo is None