예제 #1
0
def test_simple_addition():
    a = Time('05:25:45')
    b = Time('12:24:21')
    c = a + b
    assert c == Time('17:51:06')
예제 #2
0
def test_forward_multiply():
    a = Time('05:25:45')
    b = a * 2
    assert b == Time('10:51:30')
예제 #3
0
def test_backward_multiply():
    a = Time('05:25:45')
    b = 2 * a
    assert b == Time('10:51:30')
예제 #4
0
def test_modulo_addition():
    a = Time('05:25:45')
    b = Time('20:24:21')
    assert c == Time('01:51:06')
예제 #5
0
def test_wrong_format_input():
    #todo
    t = Time('12h25m36s')
    pass
예제 #6
0
def test_nominal_init():
    t = Time('12:25:36')
    assert t.hour   == 12
    assert t.minute == 25
    assert t.second == 36
예제 #7
0
def test_unphysical_input():
    #todo
    t = Time('65:25:36')
    t = Time('12:61:36')
    t = Time('12:25:61')
    pass
예제 #8
0
def test_repr():
    a = Time('02:06:46')
    assert a.__repr__() == '02h 06m 46s'