예제 #1
0
def test_is_fresh(now):
    with patch('time.time', return_value=now):
        SECONDS_ALLOWED = 2 * 86400
        stale = stub_block(now - SECONDS_ALLOWED)
        assert _isfresh(stale, SECONDS_ALLOWED)
예제 #2
0
def test_is_fresh(now):
    with patch('time.time', return_value=now):
        SECONDS_ALLOWED = 2 * 86400
        stale = stub_block(now - SECONDS_ALLOWED)
        assert _isfresh(stale, SECONDS_ALLOWED)
예제 #3
0
def test_is_not_fresh_with_no_block():
    assert not _isfresh(None, 1)
예제 #4
0
def test_is_not_fresh_with_no_block():
    assert not _isfresh(None, 1)