示例#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