6 sys.path.append("../src")
12 class TestCacheBackend(object):
14 def test_projects(self):
15 fileBackend = file_backend.FileBackend(os.tmpnam())
16 backend = cache_backend.LazyCacheBackend(fileBackend)
17 test_backend.exercise_projects(backend)
19 # Confirm cache matches actual
20 fileProjects = list(fileBackend.get_projects())
22 cacheProjects = list(backend.get_projects())
24 assert fileProjects == cacheProjects
26 def test_locations(self):
27 fileBackend = file_backend.FileBackend(os.tmpnam())
28 backend = cache_backend.LazyCacheBackend(fileBackend)
29 test_backend.exercise_locations(backend)
31 # Confirm cache matches actual
32 fileLocations = list(fileBackend.get_locations())
34 cacheLocations = list(backend.get_locations())
36 assert fileLocations == cacheLocations