Adds missing test case for ISO 8601 date parser
@@ -278,7 +278,7 @@ def test_DiscordObjectProxy():
assert dop["foo"] == dop.foo
-def test_parse_iso_8601_date_with_timezone():
+def test_parse_iso_8601_date_with_negative_timezone():
string = "2019-10-10T05:22:33.023456-02:30"
date = _utils.parse_iso_8601_datetime(string)
assert date.year == 2019
@@ -292,6 +292,20 @@ def test_parse_iso_8601_date_with_timezone():
assert offset == datetime.timedelta(hours=-2, minutes=-30)
+def test_parse_iso_8601_date_with_positive_timezone():
+ string = "2019-10-10T05:22:33.023456+02:30"
+ date = _utils.parse_iso_8601_datetime(string)
+ assert date.year == 2019
+ assert date.month == 10
+ assert date.day == 10
+ assert date.hour == 5
+ assert date.minute == 22
+ assert date.second == 33
+ assert date.microsecond == 23456
+ offset = date.tzinfo.utcoffset(None)
+ assert offset == datetime.timedelta(hours=2, minutes=30)
+
+
def test_parse_iso_8601_date_with_zulu():
string = "2019-10-10T05:22:33.023456Z"
date = _utils.parse_iso_8601_datetime(string)
