diff options
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources')
10 files changed, 33 insertions, 17 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/handlers.py b/utils/test/testapi/opnfv_testapi/resources/handlers.py index 955fbbef7..dbf94eb75 100644 --- a/utils/test/testapi/opnfv_testapi/resources/handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/handlers.py @@ -26,10 +26,10 @@ import json from tornado import gen from tornado import web -import models from opnfv_testapi.common import check from opnfv_testapi.common import message from opnfv_testapi.common import raises +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger DEFAULT_REPRESENTATION = "application/json" diff --git a/utils/test/testapi/opnfv_testapi/resources/models.py b/utils/test/testapi/opnfv_testapi/resources/models.py index 0ea482fd2..e8fc532b7 100644 --- a/utils/test/testapi/opnfv_testapi/resources/models.py +++ b/utils/test/testapi/opnfv_testapi/resources/models.py @@ -14,9 +14,8 @@ # feng.xiaowei@zte.com.cn mv TestResut to result_models.py 5-23-2016 # feng.xiaowei@zte.com.cn add ModelBase 12-20-2016 ############################################################################## -import copy import ast - +import copy from opnfv_testapi.tornado_swagger import swagger diff --git a/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py b/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py index e21841d33..502988752 100644 --- a/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py @@ -7,8 +7,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import handlers +from opnfv_testapi.resources import pod_models from opnfv_testapi.tornado_swagger import swagger -import pod_models class GenericPodHandler(handlers.GenericApiHandler): diff --git a/utils/test/testapi/opnfv_testapi/resources/pod_models.py b/utils/test/testapi/opnfv_testapi/resources/pod_models.py index 26a9e6788..2c3ea978b 100644 --- a/utils/test/testapi/opnfv_testapi/resources/pod_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/pod_models.py @@ -6,7 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import models +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger diff --git a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py index d79cd3b61..be2950705 100644 --- a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py @@ -7,9 +7,9 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import handlers +from opnfv_testapi.resources import handlers +from opnfv_testapi.resources import project_models from opnfv_testapi.tornado_swagger import swagger -import project_models class GenericProjectHandler(handlers.GenericApiHandler): diff --git a/utils/test/testapi/opnfv_testapi/resources/project_models.py b/utils/test/testapi/opnfv_testapi/resources/project_models.py index f7323c1c4..3243882bd 100644 --- a/utils/test/testapi/opnfv_testapi/resources/project_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/project_models.py @@ -6,7 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import models +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger diff --git a/utils/test/testapi/opnfv_testapi/resources/result_models.py b/utils/test/testapi/opnfv_testapi/resources/result_models.py index 50445fc22..62a6dacff 100644 --- a/utils/test/testapi/opnfv_testapi/resources/result_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/result_models.py @@ -6,7 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import models +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py index b84accf4d..467cff241 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py @@ -1,4 +1,4 @@ -import models +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger diff --git a/utils/test/testapi/opnfv_testapi/resources/testcase_models.py b/utils/test/testapi/opnfv_testapi/resources/testcase_models.py index 8cc3c6c6a..2379dfc4c 100644 --- a/utils/test/testapi/opnfv_testapi/resources/testcase_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/testcase_models.py @@ -6,19 +6,20 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import models +from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger @swagger.model() class TestcaseCreateRequest(models.ModelBase): def __init__(self, name, url=None, description=None, - tier=None, ci_loop=None, criteria=None, - blocking=None, dependencies=None, run=None, + catalog_description=None, tier=None, ci_loop=None, + criteria=None, blocking=None, dependencies=None, run=None, domains=None, tags=None, version=None): self.name = name self.url = url self.description = description + self.catalog_description = catalog_description self.tier = tier self.ci_loop = ci_loop self.criteria = criteria @@ -34,11 +35,12 @@ class TestcaseCreateRequest(models.ModelBase): @swagger.model() class TestcaseUpdateRequest(models.ModelBase): def __init__(self, name=None, description=None, project_name=None, - tier=None, ci_loop=None, criteria=None, - blocking=None, dependencies=None, run=None, + catalog_description=None, tier=None, ci_loop=None, + criteria=None, blocking=None, dependencies=None, run=None, domains=None, tags=None, version=None, trust=None): self.name = name self.description = description + self.catalog_description = catalog_description self.project_name = project_name self.tier = tier self.ci_loop = ci_loop @@ -56,14 +58,15 @@ class TestcaseUpdateRequest(models.ModelBase): class Testcase(models.ModelBase): def __init__(self, _id=None, name=None, project_name=None, description=None, url=None, creation_date=None, - tier=None, ci_loop=None, criteria=None, - blocking=None, dependencies=None, run=None, + catalog_description=None, tier=None, ci_loop=None, + criteria=None, blocking=None, dependencies=None, run=None, domains=None, tags=None, version=None, trust=None): self._id = None self.name = None self.project_name = None self.description = None + self.catalog_description = None self.url = None self.creation_date = None self.tier = None diff --git a/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py b/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py new file mode 100644 index 000000000..ac8f816a4 --- /dev/null +++ b/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py @@ -0,0 +1,14 @@ +from opnfv_testapi.resources.handlers import GenericApiHandler +from opnfv_testapi.tornado_swagger import settings + + +class UIHandler(GenericApiHandler): + def initialize(self, **kwargs): + self.static_path = settings.docs_settings.get('static_path') + self.base_url = 'http://localhost:8000' + + def get_template_path(self): + return self.static_path + + def get(self): + self.render('testapi-ui/index.html') |