Пример #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