Cache provisional weekday timetables
This commit is contained in:
parent
378d2484d0
commit
bc7cb9cffa
6 changed files with 686 additions and 58 deletions
|
|
@ -40,3 +40,10 @@ def test_get_cached_expired_returns_none(tmp_cache):
|
|||
old = time.time() - 25 * 3600 # 25 hours ago
|
||||
os.utime(path, (old, old))
|
||||
assert get_cached('k', ttl=24 * 3600) is None
|
||||
|
||||
|
||||
def test_get_cached_invalid_json_returns_none(tmp_cache):
|
||||
path = tmp_cache / 'broken.json'
|
||||
path.write_text('{"not": "finished"')
|
||||
|
||||
assert get_cached('broken') is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue