Skip to content

Commit

Permalink
Add test for interpreting UTC as an integer offset
Browse files Browse the repository at this point in the history
Co-authored-by: Brock Mendel <jbrockmendel@gmail.com>
  • Loading branch information
pganssle and jbrockmendel committed Mar 20, 2019
1 parent b8bb468 commit 3a7f619
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dateutil/test/test_parser.py
Expand Up @@ -395,6 +395,13 @@ def tzinfos(*args, **kwargs):
res = parse(dstr, tzinfos=tzinfos)
self.assert_equal_same_tz(res, expected)

def test_valid_tzinfo_int_input(self):
dstr = "2014 January 19 09:00 UTC"
tzinfos = {u"UTC": -28800}
expected = datetime(2014, 1, 19, 9, tzinfo=tz.tzoffset(u"UTC", -28800))
res = parse(dstr, tzinfos=tzinfos)
self.assert_equal_same_tz(res, expected)


class ParserTest(unittest.TestCase):

Expand Down

0 comments on commit 3a7f619

Please sign in to comment.