From 265e10a036b545d9d4e15bebef17e38e4b013af3 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Tue, 14 Nov 2017 15:38:56 +0530 Subject: 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 --- testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'testapi/opnfv_testapi/tests/unit/handlers/test_testcase.py') 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) -- cgit 1.2.3-korg