From 17fd1aec04ec462af81a8f5ea7b96251d2d4716e Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 1 Jun 2016 17:00:11 +0800 Subject: 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 --- .../opnfv_testapi/tests/unit/test_base.py | 24 ++-------------------- .../opnfv_testapi/tests/unit/test_result.py | 3 ++- 2 files changed, 4 insertions(+), 23 deletions(-) (limited to 'utils/test/result_collection_api/opnfv_testapi/tests') 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__' -- cgit 1.2.3-korg