summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Twomey <michael.twomey@fieldaware.com>2013-10-18 17:07:54 +0100
committerMichael Twomey <michael.twomey@fieldaware.com>2013-10-18 17:07:54 +0100
commitc7f06717462f20ee7829f42f1ea41a8becac3edc (patch)
tree5a667c2ac33ac8eaf4a8f66faf8f3f88c6c15ed9
parentad5f1dd41a0683d073eecfb46276066a7d5f912f (diff)
downloadpyiso8601-c7f06717462f20ee7829f42f1ea41a8becac3edc.tar.gz
Added testcase from https://code.google.com/p/pyiso8601/issues/detail?id=14
-rw-r--r--iso8601/test_iso8601.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/iso8601/test_iso8601.py b/iso8601/test_iso8601.py
index d684bd2..30d6a1d 100644
--- a/iso8601/test_iso8601.py
+++ b/iso8601/test_iso8601.py
@@ -34,6 +34,8 @@ def test_parse_utc_different_default():
("23",),
("131015T142533Z",),
("131015",),
+ ("2007-06-23X06:40:34.00Z", ), # https://code.google.com/p/pyiso8601/issues/detail?id=14
+ ("2007-06-23 06:40:34.00Zrubbish", ), # https://code.google.com/p/pyiso8601/issues/detail?id=14
])
def test_parse_invalid_date(invalid_date):
with pytest.raises(iso8601.ParseError) as exc:
@@ -51,6 +53,7 @@ def test_parse_invalid_date(invalid_date):
("2013-10-15T18:30Z", datetime.datetime(2013, 10, 15, 18, 30, 0, 0, iso8601.UTC)),
("2013-10-15T22:30+04", datetime.datetime(2013, 10, 15, 22, 30, 0, 0, iso8601.FixedOffset(4, 0, "+04:00"))), # <time>±hh:mm
("2013-10-15T1130-0700", datetime.datetime(2013, 10, 15, 11, 30, 0, 0, iso8601.FixedOffset(-7, 0, "-07:00"))), # <time>±hhmm
+ ("2013-10-15T1130+0700", datetime.datetime(2013, 10, 15, 11, 30, 0, 0, iso8601.FixedOffset(+7, 0, "+07:00"))), # <time>±hhmm
("2013-10-15T15:00-03:30", datetime.datetime(2013, 10, 15, 15, 0, 0, 0, iso8601.FixedOffset(-3, 30, "-03:30"))), # <time>±hh
("2013-10-15T183123Z", datetime.datetime(2013, 10, 15, 18, 31, 23, 0, iso8601.UTC)), # hhmmss
("2013-10-15T1831Z", datetime.datetime(2013, 10, 15, 18, 31, 0, 0, iso8601.UTC)), # hhmm