diff options
author | 2016-05-27 16:55:17 +0800 | |
---|---|---|
committer | 2016-05-27 16:58:48 +0800 | |
commit | 3a03a7efbdaf54fa5789c8d08119c7ac5b8f0a08 (patch) | |
tree | 166aa5961b3e8fadff571a74cb252a624ecd3a5d /result_collection_api/tests/unit/test_testcase.py | |
parent | 07b1553b8f00933d7d0f057ac1558a4f7d80245e (diff) |
swagger-ize testcase-apis of testAPI
Change-Id: Ibe4b068fd667b796455be3fd4d9701d50879aace
JIRA: FUNCTEST-266
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/tests/unit/test_testcase.py')
-rw-r--r-- | result_collection_api/tests/unit/test_testcase.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/result_collection_api/tests/unit/test_testcase.py b/result_collection_api/tests/unit/test_testcase.py index 712a4e7..c6c0608 100644 --- a/result_collection_api/tests/unit/test_testcase.py +++ b/result_collection_api/tests/unit/test_testcase.py @@ -14,11 +14,11 @@ __author__ = '__serena__' class TestCaseBase(TestBase): def setUp(self): super(TestCaseBase, self).setUp() - self.req_d = TestcaseCreateRequest('/cases/vping_1', - 'vping_1', + self.req_d = TestcaseCreateRequest('vping_1', + '/cases/vping_1', 'vping-ssh test') - self.req_e = TestcaseCreateRequest('/cases/doctor_1', - 'doctor_1', + self.req_e = TestcaseCreateRequest('doctor_1', + '/cases/doctor_1', 'create doctor') self.update_d = TestcaseUpdateRequest('vping_1', 'vping-ssh test', @@ -81,6 +81,18 @@ class TestCaseCreate(TestCaseBase): self.assertEqual(code, HTTP_FORBIDDEN) self.assertIn('Could not find project', body) + def test_emptyName(self): + req_empty = TestcaseCreateRequest('') + (code, body) = self.create(req_empty, self.project) + self.assertEqual(code, HTTP_BAD_REQUEST) + self.assertIn('testcase name missing', body) + + def test_noneName(self): + req_none = TestcaseCreateRequest(None) + (code, body) = self.create(req_none, self.project) + self.assertEqual(code, HTTP_BAD_REQUEST) + self.assertIn('testcase name missing', body) + def test_success(self): code, body = self.create_d() self.assertEqual(code, HTTP_OK) |