예제 #1
0
def test_a_while_ago():
    dt = time.mktime(time.gmtime())
    then = a_while_ago(seconds=10)
    t = time.mktime(str_to_time(then))
    delta = dt - t  # slightly less than 10
    assert 9 <= delta <= 10
예제 #2
0
def test_a_while_ago():
    dt = time.mktime(time.gmtime())
    then = a_while_ago(seconds=10)
    t = time.mktime(str_to_time(then))
    delta = dt - t  # slightly less than 10
    assert delta == 10