Handlers: cleanup and fixes.

This commit is contained in:
grossmj
2016-05-13 18:00:07 -06:00
parent 885d93be02
commit f81d35cc29
33 changed files with 723 additions and 766 deletions

View File

@ -121,18 +121,18 @@ def test_addProject(controller, async_run):
uuid1 = str(uuid.uuid4())
uuid2 = str(uuid.uuid4())
async_run(controller.addProject(project_id=uuid1))
async_run(controller.add_project(project_id=uuid1))
assert len(controller.projects) == 1
async_run(controller.addProject(project_id=uuid1))
async_run(controller.add_project(project_id=uuid1))
assert len(controller.projects) == 1
async_run(controller.addProject(project_id=uuid2))
async_run(controller.add_project(project_id=uuid2))
assert len(controller.projects) == 2
def test_remove_project(controller, async_run):
uuid1 = str(uuid.uuid4())
project1 = async_run(controller.addProject(project_id=uuid1))
project1 = async_run(controller.add_project(project_id=uuid1))
assert len(controller.projects) == 1
controller.remove_project(project1)
@ -146,13 +146,13 @@ def test_addProject_with_compute(controller, async_run):
compute.post = MagicMock()
controller._computes = {"test1": compute}
project1 = async_run(controller.addProject(project_id=uuid1))
project1 = async_run(controller.add_project(project_id=uuid1))
def test_getProject(controller, async_run):
uuid1 = str(uuid.uuid4())
project = async_run(controller.addProject(project_id=uuid1))
project = async_run(controller.add_project(project_id=uuid1))
assert controller.get_project(uuid1) == project
with pytest.raises(aiohttp.web.HTTPNotFound):
assert controller.get_project("dsdssd")