Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
 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())
Beispiel #4
0
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
Beispiel #5
0
 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())
Beispiel #6
0
 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())
Beispiel #7
0
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
Beispiel #8
0
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
Beispiel #9
0
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