summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2017-11-14 15:38:56 +0530
committerthuva4 <tharma.thuva@gmail.com>2017-11-14 15:38:56 +0530
commit265e10a036b545d9d4e15bebef17e38e4b013af3 (patch)
tree253f52de1842ec2ca3dc5e33d381f6108c4c39ab /testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py
parent3b3477d3f632208d99fe2ab71679ab84b618855a (diff)
Create functionality and e2e tests for project
Implemented the create function for the projects. Wrote the e2e tests for the create function. Change-Id: Iceac650573ca31b6246350c4d60033b42e0ffb0f Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py')
-rw-r--r--testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py b/testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py
index e4c668e..d5e32e3 100644
--- a/testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py
+++ b/testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py
@@ -11,15 +11,16 @@ import httplib
import unittest
from opnfv_testapi.common import message
-from opnfv_testapi.models import project_models
from opnfv_testapi.models import testcase_models
from opnfv_testapi.tests.unit import executor
+from opnfv_testapi.tests.unit import fake_pymongo
from opnfv_testapi.tests.unit.handlers import test_base as base
class TestCaseBase(base.TestBase):
def setUp(self):
super(TestCaseBase, self).setUp()
+ self.project = 'functest'
self.req_d = testcase_models.TestcaseCreateRequest('vping_1',
'/cases/vping_1',
'vping-ssh test')
@@ -36,7 +37,7 @@ class TestCaseBase(base.TestBase):
self.list_res = testcase_models.Testcases
self.update_res = testcase_models.Testcase
self.basePath = '/api/v1/projects/%s/cases'
- self.create_project()
+ fake_pymongo.projects.insert(self.project_e.format())
def assert_body(self, case, req=None):
if not req:
@@ -56,12 +57,6 @@ class TestCaseBase(base.TestBase):
self.assertIsNotNone(new._id)
self.assertIsNotNone(new.creation_date)
- def create_project(self):
- req_p = project_models.ProjectCreateRequest('functest',
- 'vping-ssh test')
- self.create_help('/api/v1/projects', req_p)
- self.project = req_p.name
-
def create_d(self):
return super(TestCaseBase, self).create_d(self.project)