Exemplo n.º 1
0
 def test_clocks_with_negative_hours_and_minutes_that_wrap(self):
     self.assertEqual(Clock(18, 7), Clock(-54, -11513))
Exemplo n.º 2
0
 def test_subtract_minutes(self):
     self.assertEqual('10:00', str(Clock(10, 3).add(-3)))
Exemplo n.º 3
0
 def test_subtract_more_than_an_hour(self):
     self.assertEqual('09:33', str(Clock(10, 3).add(-30)))
Exemplo n.º 4
0
 def test_add_more_than_two_hours_with_carry(self):
     self.assertEqual('03:25', str(Clock(0, 45).add(160)))
Exemplo n.º 5
0
 def test_add_more_than_one_day(self):
     self.assertEqual('06:32', str(Clock(5, 32).add(1500)))
Exemplo n.º 6
0
 def test_add_no_minutes(self):
     self.assertEqual('06:41', str(Clock(6, 41).add(0)))
Exemplo n.º 7
0
 def test_add_to_next_hour(self):
     self.assertEqual('01:25', str(Clock(0, 45).add(40)))
Exemplo n.º 8
0
 def test_hour_and_minutes_roll_over_continuously(self):
     self.assertEqual('11:01', str(Clock(201, 3001)))
Exemplo n.º 9
0
 def test_hour_and_minutes_roll_over_to_exactly_midnight(self):
     self.assertEqual('00:00', str(Clock(72, 8640)))
Exemplo n.º 10
0
 def test_minutes_roll_over_continuously(self):
     self.assertEqual('04:43', str(Clock(0, 1723)))
Exemplo n.º 11
0
 def test_hour_and_minutes_roll_over(self):
     self.assertEqual('03:40', str(Clock(25, 160)))
Exemplo n.º 12
0
 def test_minutes_roll_over(self):
     self.assertEqual('02:40', str(Clock(0, 160)))
Exemplo n.º 13
0
 def test_sixty_minutes_is_next_hour(self):
     self.assertEqual('02:00', str(Clock(1, 60)))
Exemplo n.º 14
0
 def test_hour_rolls_over_continuously(self):
     self.assertEqual('04:00', str(Clock(100, 0)))
Exemplo n.º 15
0
 def test_negative_hour_and_minutes_both_roll_over_continuously(self):
     self.assertEqual('22:10', str(Clock(-121, -5810)))
Exemplo n.º 16
0
 def test_negative_hour(self):
     self.assertEqual('23:15', str(Clock(-1, 15)))
Exemplo n.º 17
0
 def test_add_minutes(self):
     self.assertEqual('10:03', str(Clock(10, 0).add(3)))
Exemplo n.º 18
0
 def test_negative_hour_rolls_over(self):
     self.assertEqual('23:00', str(Clock(-25, 0)))
Exemplo n.º 19
0
 def test_on_the_hour(self):
     self.assertEqual('08:00', str(Clock(8, 0)))
Exemplo n.º 20
0
 def test_negative_hour_rolls_over_continuously(self):
     self.assertEqual('05:00', str(Clock(-91, 0)))
Exemplo n.º 21
0
 def test_add_more_than_one_hour(self):
     self.assertEqual('11:01', str(Clock(10, 0).add(61)))
Exemplo n.º 22
0
 def test_negative_minutes(self):
     self.assertEqual('00:20', str(Clock(1, -40)))
Exemplo n.º 23
0
 def test_add_across_midnight(self):
     self.assertEqual('00:01', str(Clock(23, 59).add(2)))
Exemplo n.º 24
0
 def test_negative_minutes_roll_over(self):
     self.assertEqual('22:20', str(Clock(1, -160)))
Exemplo n.º 25
0
 def test_add_more_than_two_days(self):
     self.assertEqual('11:21', str(Clock(1, 1).add(3500)))
Exemplo n.º 26
0
 def test_negative_minutes_roll_over_continuously(self):
     self.assertEqual('16:40', str(Clock(1, -4820)))
Exemplo n.º 27
0
 def test_subtract_to_previous_hour(self):
     self.assertEqual('10:00', str(Clock(10, 3).add(-3)))
Exemplo n.º 28
0
 def test_negative_hour_and_minutes_both_roll_over(self):
     self.assertEqual('20:20', str(Clock(-25, -160)))
Exemplo n.º 29
0
 def test_subtract_across_midnight(self):
     self.assertEqual('08:53', str(Clock(10, 3).add(-70)))
Exemplo n.º 30
0
 def test_clocks_with_negative_hours_and_minutes(self):
     self.assertEqual(Clock(7, 32), Clock(-12, -268))