Cache provisional weekday timetables

This commit is contained in:
Edward Betts 2026-05-21 11:31:17 +01:00
parent 378d2484d0
commit bc7cb9cffa
6 changed files with 686 additions and 58 deletions

View file

@ -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