Пример #1
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
Пример #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_minutes_positive_big():
    dt = Time(12, 34, 56)
    assert dt.diff(dt.add(hours=25).add(minutes=2)).in_minutes() == 62
Пример #4
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())
Пример #5
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())
Пример #6
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
Пример #7
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
Пример #8
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())
Пример #9
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())
Пример #10
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
Пример #11
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
Пример #12
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
Пример #13
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
Пример #14
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
Пример #15
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
Пример #16
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())
Пример #17
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
Пример #18
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())
Пример #19
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
Пример #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