summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/opnfv_testapi/tests/unit
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-01 17:00:11 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-01 17:11:05 +0800
commit17fd1aec04ec462af81a8f5ea7b96251d2d4716e (patch)
tree7f42f2032d761e2bab681079a3376fa18bf8002f /utils/test/result_collection_api/opnfv_testapi/tests/unit
parenta55651eb098da2e1aa90c93294a59857711b48c1 (diff)
add router package to implement url-2-XXXHandlers mappings in testAPI project
and eliminate flake8 violation JIRA: FUNCTEST-285 Change-Id: I15b568a97279032549f24ff81520220e271f3488 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/opnfv_testapi/tests/unit')
-rw-r--r--utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py24
-rw-r--r--utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py3
2 files changed, 4 insertions, 23 deletions
diff --git a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py
index 8f0c28488..01c43f0f7 100644
--- a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py
+++ b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py
@@ -3,15 +3,7 @@ import json
from tornado.web import Application
from tornado.testing import AsyncHTTPTestCase
-from opnfv_testapi.resources.pod_handlers import PodCLHandler, PodGURHandler
-from opnfv_testapi.resources.project_handlers import ProjectCLHandler, \
- ProjectGURHandler
-from opnfv_testapi.resources.handlers import VersionHandler
-from opnfv_testapi.resources.testcase_handlers import TestcaseCLHandler, \
- TestcaseGURHandler
-from opnfv_testapi.resources.result_handlers import ResultsCLHandler, \
- ResultsGURHandler
-from opnfv_testapi.resources.dashboard_handlers import DashboardHandler
+from opnfv_testapi.router import url_mappings
from opnfv_testapi.resources.models import CreateResponse
import fake_pymongo
@@ -32,19 +24,7 @@ class TestBase(AsyncHTTPTestCase):
def get_app(self):
return Application(
- [
- (r"/versions", VersionHandler),
- (r"/api/v1/pods", PodCLHandler),
- (r"/api/v1/pods/([^/]+)", PodGURHandler),
- (r"/api/v1/projects", ProjectCLHandler),
- (r"/api/v1/projects/([^/]+)", ProjectGURHandler),
- (r"/api/v1/projects/([^/]+)/cases", TestcaseCLHandler),
- (r"/api/v1/projects/([^/]+)/cases/([^/]+)",
- TestcaseGURHandler),
- (r"/api/v1/results", ResultsCLHandler),
- (r"/api/v1/results/([^/]+)", ResultsGURHandler),
- (r"/dashboard/v1/results", DashboardHandler),
- ],
+ url_mappings.mappings,
db=fake_pymongo,
debug=True,
)
diff --git a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py
index 5e424f8f0..23a745fe0 100644
--- a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py
+++ b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py
@@ -7,7 +7,8 @@ from opnfv_testapi.resources.project_models import ProjectCreateRequest
from opnfv_testapi.resources.testcase_models import TestcaseCreateRequest
from opnfv_testapi.resources.result_models import ResultCreateRequest, \
TestResult, TestResults
-from opnfv_testapi.common.constants import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND
+from opnfv_testapi.common.constants import HTTP_OK, HTTP_BAD_REQUEST, \
+ HTTP_NOT_FOUND
__author__ = '__serena__'