def test_load_store(self): with TempFile(no_create=True) as tmp: with open(tmp, 'w') as f: f.write(pickle.dumps({("view", "cache", "grid"): [(0, 1), (2, 4)]})) store = ProgressStore(tmp) assert store.get(('view', 'cache', 'grid')) == [(0, 1), (2, 4)] assert store.get(('view', 'cache', 'grid2')) == None store.add(('view', 'cache', 'grid'), []) store.add(('view', 'cache', 'grid2'), [(0, 1)]) store.write() store = ProgressStore(tmp) assert store.get(('view', 'cache', 'grid')) == [] assert store.get(('view', 'cache', 'grid2')) == [(0, 1)]
def test_load_empty(self): store = ProgressStore("doesnotexist.no_realy.txt") store.load() assert store.get(("foo", "bar", "baz")) == None
def test_load_empty(self): store = ProgressStore('doesnotexist.no_realy.txt') store.load() assert store.get(('foo', 'bar', 'baz')) == None
def test_load_empty(self): store = ProgressStore('doesnotexist.no_realy.txt') store.load() assert store.get(('foo', 'bar', 'baz')) == None