summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-20 14:32:29 +0800
committerSerena Feng <feng.xiaowei@zte.com.cn>2017-02-21 03:09:59 +0000
commita2567392d367889f2fd2bb464ce8b05bce12eb0c (patch)
tree2fabbca4f7779d6695d8fa0f932f6ffb6a6daee1 /utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
parent47a6e089bb716dddf7bd2aad0c5a9e389d543156 (diff)
fix violation of import rule in TestAPI
TestAPI violate import rule of OpenStack Style a lot, like Do not import objects, only modules Do not import more than one module per line Alphabetically order your imports by the full module path This patch is mean to fix them. Change-Id: Ia05b944a74b3f443c9101a9840f613f9a6f5ae49 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
index 7c8c333a5..083bf59fc 100644
--- a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
@@ -1,17 +1,16 @@
-from opnfv_testapi.common.constants import HTTP_FORBIDDEN
-from opnfv_testapi.resources.handlers import GenericApiHandler
-from opnfv_testapi.resources.scenario_models import Scenario
+from opnfv_testapi.common import constants
+from opnfv_testapi.resources import handlers
import opnfv_testapi.resources.scenario_models as models
from opnfv_testapi.tornado_swagger import swagger
-class GenericScenarioHandler(GenericApiHandler):
+class GenericScenarioHandler(handlers.GenericApiHandler):
def __init__(self, application, request, **kwargs):
super(GenericScenarioHandler, self).__init__(application,
request,
**kwargs)
self.table = self.db_scenarios
- self.table_cls = Scenario
+ self.table_cls = models.Scenario
class ScenariosCLHandler(GenericScenarioHandler):
@@ -81,7 +80,7 @@ class ScenariosCLHandler(GenericScenarioHandler):
def error(data):
message = '{} already exists as a scenario'.format(data.name)
- return HTTP_FORBIDDEN, message
+ return constants.HTTP_FORBIDDEN, message
miss_checks = ['name']
db_checks = [(self.table, False, query, error)]