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)
def test_is_not_fresh_with_no_block(): assert not _isfresh(None, 1)