taskId = self._backend.add_task(projId, taskName)
self._invalidate_projects_tasks(projId)
self._invalidate_metaprojects_tasks()
- self._taskIdToProjId[taskId] = projId
return taskId
def set_project(self, taskId, newProjId):
def test_projects(self):
fileBackend = file_backend.FileBackend(os.tmpnam())
backend = cache_backend.LazyCacheBackend(fileBackend)
-
test_backend.exercise_projects(backend)
- test_backend.assert_projects_same(fileBackend, backend)
+ # Confirm cache matches actual
+ fileProjects = list(fileBackend.get_projects())
+ fileProjects.sort()
+ cacheProjects = list(backend.get_projects())
+ cacheProjects.sort()
+ assert fileProjects == cacheProjects
def test_locations(self):
fileBackend = file_backend.FileBackend(os.tmpnam())
backend = cache_backend.LazyCacheBackend(fileBackend)
-
test_backend.exercise_locations(backend)
- test_backend.assert_locations_same(fileBackend, backend)
-
- def test_task(self):
- fileBackend = file_backend.FileBackend(os.tmpnam())
- backend = cache_backend.LazyCacheBackend(fileBackend)
- proj1Id = backend.add_project("p1")
- proj2Id = backend.add_project("p2")
-
- test_backend.exercise_task(backend, proj1Id, proj2Id)
-
- test_backend.assert_tasks_same(fileBackend, backend, proj1Id)
- test_backend.assert_tasks_same(fileBackend, backend, proj2Id)
+ # Confirm cache matches actual
+ fileLocations = list(fileBackend.get_locations())
+ fileLocations.sort()
+ cacheLocations = list(backend.get_locations())
+ cacheLocations.sort()
+ assert fileLocations == cacheLocations
def test_locations(self):
backend = file_backend.FileBackend(os.tmpnam())
test_backend.exercise_locations(backend)
-
- def test_task(self):
- backend = file_backend.FileBackend(os.tmpnam())
- proj1Id = backend.add_project("p1")
- proj2Id = backend.add_project("p2")
- test_backend.exercise_task(backend, proj1Id, proj2Id)