Skip to content

Commit

Permalink
Add unit tests for dumpers.TimerPointDumper.get_time_zone
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Oct 2, 2018
1 parent d7c24fb commit 4e6eecf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions isodatetime/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,27 @@ def test_timepoint_dumper_bounds_error_message(self):
self.assertTrue("20" in the_string,
"Failed to find TimePoint1 in {}".format(the_string))

get_test_timepoint_dumper_get_time_zone = [
["+250:00", None],
["+25:00", ('25', '00')],
["+12:00", ('12', '00')],
["+12:45", ('12', '45')],
["+01:00", ('01', '00')],
["Z", (0, 0)],
["-03:00", (-3, 0)],
["-03:30", (-3, -30)],
["-11:00", (-11, 0)],
["+00:00", ('00', '00')],
["-00:00", (0, 0)]
]

def test_timepoint_dumper_get_time_zone(self):
"""Test the time zone returned by TimerPointDumper.get_time_zone"""
dumper = dumpers.TimePointDumper(num_expanded_year_digits=2)
for value, expected in self.get_test_timepoint_dumper_get_time_zone:
tz = dumper.get_time_zone(value)
self.assertEqual(expected, tz)

def test_timepoint_parser(self):
"""Test the parsing of date/time expressions."""

Expand Down

0 comments on commit 4e6eecf

Please sign in to comment.