def test_is_locked_when_rate_limit_not_refreshed(): """query.is_locked() should return True if lockfile exists and contains timestamp < beginning of today""" f = mkfixture("rate_limit_not_refreshed", f"{int(datetime.today().timestamp())} locked", True) q = Query() q.lockfile = f assert q.is_locked()
def test_is_locked_when_status_pending(): """query.is_locked() should return False if lockfile exists and contains status of pending""" f = mkfixture("status_pending", "_ pending") q = Query() q.lockfile = f assert not q.is_locked()
def test_is_locked_when_no_lockfile(): """query.is_locked() should return False if lockfile does not exist""" q = Query() assert not q.is_locked()