예제 #1
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
예제 #2
0
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
예제 #3
0
def test_diff_in_hours_positive():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(hours=2).add(seconds=3672)).in_hours() == 3
예제 #4
0
def test_diff_in_seconds_positive():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(minutes=1).add(seconds=2)).in_seconds() == 62
예제 #5
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
예제 #6
0
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
예제 #7
0
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
예제 #8
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())
예제 #9
0
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
예제 #10
0
def test_diff_in_seconds_positive():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(minutes=1).add(seconds=2)).in_seconds() == 62
예제 #11
0
def test_diff_in_hours_positive():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(hours=2).add(seconds=3672)).in_hours() == 3
예제 #12
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
예제 #13
0
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
예제 #14
0
 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())
예제 #15
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
예제 #16
0
 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())
예제 #17
0
def test_diff_in_seconds_ensure_is_truncated():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(seconds=1.9)).in_seconds() == 1
예제 #18
0
 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())
예제 #19
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())
예제 #20
0
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
예제 #21
0
 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())
예제 #22
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
예제 #23
0
 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())
예제 #24
0
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
예제 #25
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())
예제 #26
0
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
예제 #27
0
 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())
예제 #28
0
def test_diff_in_seconds_ensure_is_truncated():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(seconds=1.9)).in_seconds() == 1
예제 #29
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