Skip to content

Commit

Permalink
Merge branch 'test-coverage' of 'https://github.com/VSevagen/grimoire…
Browse files Browse the repository at this point in the history
…lab-toolkit'

Merges #35
Closes #35
  • Loading branch information
sduenas committed Apr 6, 2021
2 parents 5bf8fc8 + 761009d commit dfbb5e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ def test_conversion(self):
self.assertIsInstance(utc, datetime.datetime)
self.assertEqual(utc, expected)

def test_invalid_timezone(self):
""" Check whether datetime converts to UTC when timezone invalid """

date = datetime.datetime(2001, 12, 1, 23, 15, 32,
tzinfo=dateutil.tz.tzoffset(None, 93600))
expected = datetime.datetime(2001, 12, 1, 23, 15, 32,
tzinfo=dateutil.tz.tzutc())
utc = datetime_to_utc(date)
self.assertIsInstance(utc, datetime.datetime)
self.assertEqual(utc, expected)

def test_invalid_datetime(self):
"""Check if it raises an exception on invalid instances."""

Expand Down

0 comments on commit dfbb5e8

Please sign in to comment.