def test_diff_in_seconds_negative_no_sign(): dt = Time(12, 34, 56) assert dt.diff(dt.subtract(minutes=1).add(seconds=2)).in_seconds() == 58
def test_diff_in_hours_ensure_is_truncated(): dt = Time(12, 34, 56) assert dt.diff(dt.add(hours=2).add(seconds=5401)).in_hours() == 3
def test_diff_in_hours_positive(): dt = Time(12, 34, 56) assert dt.diff(dt.add(hours=2).add(seconds=3672)).in_hours() == 3
def test_diff_in_seconds_positive(): dt = Time(12, 34, 56) assert dt.diff(dt.add(minutes=1).add(seconds=2)).in_seconds() == 62
def test_diff_in_hours_negative_no_sign(): dt = Time(12, 34, 56) assert dt.diff(dt.subtract(hours=2).add(seconds=3600)).in_hours() == 1
def test_diff_in_minutes_positive_big(): dt = Time(12, 34, 56) assert dt.diff(dt.add(hours=25).add(minutes=2)).in_minutes() == 62
def test_diff_in_seconds_positive_big(): dt = Time(12, 34, 56) assert dt.diff(dt.add(hours=2).add(seconds=2)).in_seconds() == 7202
def test_diff_in_seconds_negative_no_sign(self): dt = Time(12, 34, 56) self.assertEqual( 58, dt.diff(dt.subtract(minutes=1).add(seconds=2)).in_seconds())
def test_diff_in_minutes_ensure_is_truncated(): dt = Time(12, 34, 56) assert dt.diff(dt.add(minutes=1).add(seconds=59)).in_minutes() == 1
def test_diff_in_minutes_negative_with_sign(): dt = Time(12, 34, 56) assert dt.diff(dt.subtract(hours=1).add(minutes=2), False).in_minutes() == -58
def test_diff_in_hours_positive(self): dt = Time(12, 34, 56) self.assertEqual(3, dt.diff(dt.add(hours=2).add(seconds=3672)).in_hours())
def test_diff_in_seconds_positive_big(self): dt = Time(12, 34, 56) self.assertEqual(7202, dt.diff(dt.add(hours=2).add(seconds=2)).in_seconds())
def test_diff_in_seconds_ensure_is_truncated(): dt = Time(12, 34, 56) assert dt.diff(dt.add(seconds=1.9)).in_seconds() == 1
def test_diff_in_seconds_ensure_is_truncated(self): dt = Time(12, 34, 56) self.assertEqual(1, dt.diff(dt.add(seconds=1.9)).in_seconds())
def test_diff_in_hours_negative_no_sign(self): dt = Time(12, 34, 56) self.assertEqual( 1, dt.diff(dt.subtract(hours=2).add(seconds=3600)).in_hours())
def test_diff_in_hours_ensure_is_truncated(self): dt = Time(12, 34, 56) self.assertEqual(3, dt.diff(dt.add(hours=2).add(seconds=5401)).in_hours())
def test_diff_in_minutes_positive_big(self): dt = Time(12, 34, 56) self.assertEqual(62, dt.diff(dt.add(hours=25).add(minutes=2)).in_minutes())
def test_diff_in_minutes_negative_with_sign(self): dt = Time(12, 34, 56) self.assertEqual( -58, dt.diff(dt.subtract(hours=1).add(minutes=2), False).in_minutes())
def test_diff_in_seconds_positive(self): dt = Time(12, 34, 56) self.assertEqual( 62, dt.diff(dt.add(minutes=1).add(seconds=2)).in_seconds())