summaryrefslogtreecommitdiffstats
path: root/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
commit2d2a12935a39aa8fc7dc615da9058085a1661876 (patch)
tree70fbc1b091beeded79200fb0df16e9c336530148 /result_collection_api/opnfv_testapi/tests/unit
parent59cba325d8132186d27aefa959d4bed730e4e68d (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 'result_collection_api/opnfv_testapi/tests/unit')
-rw-r--r--result_collection_api/opnfv_testapi/tests/unit/test_base.py24
-rw-r--r--result_collection_api/opnfv_testapi/tests/unit/test_result.py3
2 files changed, 4 insertions, 23 deletions
diff --git a/result_collection_api/opnfv_testapi/tests/unit/test_base.py b/result_collection_api/opnfv_testapi/tests/unit/test_base.py
index 8f0c284..01c43f0 100644
--- a/result_collection_api/opnfv_testapi/tests/unit/test_base.py
+++ b/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/result_collection_api/opnfv_testapi/tests/unit/test_result.py b/result_collection_api/opnfv_testapi/tests/unit/test_result.py
index 5e424f8..23a745f 100644
--- a/result_collection_api/opnfv_testapi/tests/unit/test_result.py
+++ b/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__'