diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-05-20 15:56:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-05-20 15:56:37 +0000 |
commit | 2521fa58f84f85f09f1f2e01f182aaa1270d759f (patch) | |
tree | 5c35fdc432c869448092ee642715f1c8e1fa7bae /utils/test/result_collection_api/tests/unit/test_project.py | |
parent | 1e67c1ac934118ddb84fe05a656484107e19ee65 (diff) | |
parent | eb168d7608278b670b3178099766ef0c78d3d85a (diff) |
Merge "add unittests for testcase and refactor testcase related implementation"
Diffstat (limited to 'utils/test/result_collection_api/tests/unit/test_project.py')
-rw-r--r-- | utils/test/result_collection_api/tests/unit/test_project.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/utils/test/result_collection_api/tests/unit/test_project.py b/utils/test/result_collection_api/tests/unit/test_project.py index e79311197..6ce21db24 100644 --- a/utils/test/result_collection_api/tests/unit/test_project.py +++ b/utils/test/result_collection_api/tests/unit/test_project.py @@ -66,23 +66,23 @@ class TestProjectGet(TestProjectBase): class TestProjectUpdate(TestProjectBase): def test_withoutBody(self): - code, _ = self.update('noBody') + code, _ = self.update(None, 'noBody') self.assertEqual(code, HTTP_BAD_REQUEST) def test_notFound(self): - code, _ = self.update('notFound', self.req_e) + code, _ = self.update(self.req_e, 'notFound') self.assertEqual(code, HTTP_NOT_FOUND) def test_newNameExist(self): self.create_d() self.create_e() - code, body = self.update(self.req_d.name, self.req_e) + code, body = self.update(self.req_e, self.req_d.name) self.assertEqual(code, HTTP_FORBIDDEN) self.assertIn("already exists", body) def test_noUpdate(self): self.create_d() - code, body = self.update(self.req_d.name, self.req_d) + code, body = self.update(self.req_d, self.req_d.name) self.assertEqual(code, HTTP_FORBIDDEN) self.assertIn("Nothing to update", body) @@ -92,7 +92,7 @@ class TestProjectUpdate(TestProjectBase): _id = body._id req = ProjectCreateRequest('newName', 'new description') - code, body = self.update(self.req_d.name, req) + code, body = self.update(req, self.req_d.name) self.assertEqual(code, HTTP_OK) self.assertEqual(_id, body._id) self.assert_body(body, req) @@ -104,13 +104,17 @@ class TestProjectUpdate(TestProjectBase): class TestProjectDelete(TestProjectBase): def test_notFound(self): - code = self.delete('notFound') + code, body = self.delete('notFound') self.assertEqual(code, HTTP_NOT_FOUND) def test_success(self): self.create_d() - code = self.delete(self.req_d.name) + code, body = self.delete(self.req_d.name) self.assertEqual(code, HTTP_OK) + self.assertEqual(body, '') + + code, body = self.get(self.req_d.name) + self.assertEqual(code, HTTP_NOT_FOUND) if __name__ == '__main__': unittest.main() |