def test_parse_timers_error2(self): with self.assertRaises(ValueError) as cm: tuple(parse_timers(''' 1:23 - :56 19:00 - 5:00 ''')) self.assertEqual(cm.exception.args[0], 'Wrong time in line 1')
def test_parse_timers2(self): assert tuple(parse_timers(''' 1:23 4:56 Foo 19:00 X 20:00 Bar ''')) == ( ((1, 23), (4, 56)), ((19, 0), (20, 0)) )
def test_reorder_timers1(self): assert tuple(parse_timers(''' 10:00 - 12:00 10:30 - 13:00 ''')) == ( ((10, 0), (10, 30)), ((12, 0), (13, 0)) )
def test_parse_timers(self): assert tuple(parse_timers(''' 1:23 - 4:56 19:00 - 20:00 ''')) == ( ((1, 23), (4, 56)), ((19, 0), (20, 0)) )
def test_parse_timers_not_sequential1(self): with self.assertRaises(ValueError) as cm: tuple(parse_timers(''' 2:00 - 1:00 ''')) self.assertEqual(cm.exception.args[0], 'Times in line 1 are not sequential!')