From 5eae42a2e355e671e7906aa6e0d3d885dfd85c4b Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 1 Jun 2016 17:36:45 +0800 Subject: [PATCH] change the usage of tornado_swagger package changes: move tornado_swagger package out of tornado_swagger_ui remove tornado_swagger_ui modify files that import tornado_swagger originally: opnfv_testapi.tornado_swagger_ui.tornado_swagger to: opnfv_testapi.tornado_swagger modify setup.cfg to delete tornado_swagger_ui prefix JIRA: FUNCTEST-286 Change-Id: I1e8972e4fbe26ad3a5d945f3aed6783d0b666a5f Signed-off-by: SerenaFeng --- .../opnfv_testapi/cmd/server.py | 2 +- .../opnfv_testapi/resources/dashboard_handlers.py | 2 +- .../opnfv_testapi/resources/handlers.py | 2 +- .../opnfv_testapi/resources/models.py | 2 +- .../opnfv_testapi/resources/pod_handlers.py | 2 +- .../opnfv_testapi/resources/pod_models.py | 2 +- .../opnfv_testapi/resources/project_handlers.py | 2 +- .../opnfv_testapi/resources/project_models.py | 2 +- .../opnfv_testapi/resources/result_handlers.py | 2 +- .../opnfv_testapi/resources/result_models.py | 2 +- .../opnfv_testapi/resources/testcase_handlers.py | 2 +- .../opnfv_testapi/resources/testcase_models.py | 2 +- .../__init__.py | 0 .../tornado_swagger/handlers.py | 0 .../tornado_swagger/settings.py | 0 .../tornado_swagger/static/.gitignore | 0 .../static/css/highlight.default.css | 0 .../static/css/hightlight.default.css | 0 .../tornado_swagger/static/css/screen.css | 0 .../tornado_swagger/static/endpoint.html | 0 .../static/images/explorer_icons.png | Bin .../tornado_swagger/static/images/logo_small.png | Bin .../static/images/pet_store_api.png | Bin .../tornado_swagger/static/images/throbber.gif | Bin .../tornado_swagger/static/images/wordnik_api.png | Bin .../tornado_swagger/static/index.html | 0 .../tornado_swagger/static/lib/backbone-min.js | 0 .../tornado_swagger/static/lib/handlebars-1.0.0.js | 0 .../static/lib/highlight.7.3.pack.js | 0 .../tornado_swagger/static/lib/jquery-1.8.0.min.js | 0 .../static/lib/jquery.ba-bbq.min.js | 0 .../static/lib/jquery.slideto.min.js | 0 .../static/lib/jquery.wiggle.min.js | 0 .../tornado_swagger/static/lib/shred.bundle.js | 0 .../tornado_swagger/static/lib/shred/content.js | 0 .../tornado_swagger/static/lib/swagger-oauth.js | 0 .../tornado_swagger/static/lib/swagger.js | 0 .../tornado_swagger/static/lib/underscore-min.js | 0 .../tornado_swagger/static/o2c.html | 0 .../tornado_swagger/static/swagger-ui.js | 0 .../tornado_swagger/static/swagger-ui.min.js | 0 .../tornado_swagger/swagger.py | 0 .../tornado_swagger/views.py | 0 .../opnfv_testapi/tornado_swagger_ui/LICENSE | 20 -- .../opnfv_testapi/tornado_swagger_ui/README | 1 - .../opnfv_testapi/tornado_swagger_ui/README.md | 277 --------------------- .../tornado_swagger_ui/example/basic.py | 219 ---------------- .../opnfv_testapi/tornado_swagger_ui/setup.py | 30 --- .../tornado_swagger_ui/tornado_swagger/__init__.py | 4 - utils/test/result_collection_api/setup.cfg | 10 +- 50 files changed, 17 insertions(+), 568 deletions(-) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => tornado_swagger}/__init__.py (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/handlers.py (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/settings.py (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/.gitignore (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/css/highlight.default.css (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/css/hightlight.default.css (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/css/screen.css (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/endpoint.html (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/images/explorer_icons.png (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/images/logo_small.png (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/images/pet_store_api.png (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/images/throbber.gif (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/images/wordnik_api.png (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/index.html (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/backbone-min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/handlebars-1.0.0.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/highlight.7.3.pack.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/jquery-1.8.0.min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/jquery.ba-bbq.min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/jquery.slideto.min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/jquery.wiggle.min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/shred.bundle.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/shred/content.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/swagger-oauth.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/swagger.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/lib/underscore-min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/o2c.html (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/swagger-ui.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/static/swagger-ui.min.js (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/swagger.py (100%) rename utils/test/result_collection_api/opnfv_testapi/{tornado_swagger_ui => }/tornado_swagger/views.py (100%) delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README.md delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/example/basic.py delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/setup.py delete mode 100644 utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/__init__.py diff --git a/utils/test/result_collection_api/opnfv_testapi/cmd/server.py b/utils/test/result_collection_api/opnfv_testapi/cmd/server.py index 1031fbbb3..9022b9aa1 100644 --- a/utils/test/result_collection_api/opnfv_testapi/cmd/server.py +++ b/utils/test/result_collection_api/opnfv_testapi/cmd/server.py @@ -35,7 +35,7 @@ import tornado.ioloop import motor from opnfv_testapi.common.config import APIConfig -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger from opnfv_testapi.router import url_mappings # optionally get config file from command line diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/dashboard_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/dashboard_handlers.py index 00abbb92b..82bf8d252 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/dashboard_handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/dashboard_handlers.py @@ -6,7 +6,7 @@ from opnfv_testapi.dashboard.dashboard_utils import \ check_dashboard_ready_case, get_dashboard_result from opnfv_testapi.resources.result_handlers import GenericResultHandler from opnfv_testapi.resources.result_models import TestResult -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger class GenericDashboardHandler(GenericResultHandler): diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/handlers.py index 4b39b247a..3d39502db 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/handlers.py @@ -29,7 +29,7 @@ from tornado import gen from models import CreateResponse from opnfv_testapi.common.constants import DEFAULT_REPRESENTATION, \ HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_FORBIDDEN -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger class GenericApiHandler(RequestHandler): diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/models.py b/utils/test/result_collection_api/opnfv_testapi/resources/models.py index 881f65dd3..290a7f39d 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/models.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/models.py @@ -13,7 +13,7 @@ # feng.xiaowei@zte.com.cn mv TestCase to testcase_models.py 5-20-2016 # feng.xiaowei@zte.com.cn mv TestResut to result_models.py 5-23-2016 ############################################################################## -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger class CreateResponse(object): diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py index 5a4b55506..d9e6686d8 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger from handlers import GenericApiHandler from pod_models import Pod from opnfv_testapi.common.constants import HTTP_FORBIDDEN diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py b/utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py index 2e645032c..3e6f5a888 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger __author__ = '__serena__' diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py index 191a93347..30fb40247 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger from handlers import GenericApiHandler from opnfv_testapi.common.constants import HTTP_FORBIDDEN from project_models import Project diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/project_models.py b/utils/test/result_collection_api/opnfv_testapi/resources/project_models.py index fbb6beba3..1014254b8 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/project_models.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/project_models.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger __author__ = '__serena__' diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py index a9aa17bba..9358c7103 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py @@ -6,7 +6,7 @@ from tornado.web import HTTPError from opnfv_testapi.common.constants import HTTP_BAD_REQUEST, HTTP_NOT_FOUND from opnfv_testapi.resources.handlers import GenericApiHandler from opnfv_testapi.resources.result_models import TestResult -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger class GenericResultHandler(GenericApiHandler): diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/result_models.py b/utils/test/result_collection_api/opnfv_testapi/resources/result_models.py index cf896735f..b3bb95bbf 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/result_models.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/result_models.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger @swagger.model() diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py index dbeebeb98..4b825f284 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py @@ -1,7 +1,7 @@ from opnfv_testapi.common.constants import HTTP_FORBIDDEN from opnfv_testapi.resources.handlers import GenericApiHandler from opnfv_testapi.resources.testcase_models import Testcase -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger class GenericTestcaseHandler(GenericApiHandler): diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py b/utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py index aa5789e70..e3718a6f8 100644 --- a/utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py +++ b/utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py @@ -1,4 +1,4 @@ -from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger +from opnfv_testapi.tornado_swagger import swagger __author__ = '__serena__' diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/__init__.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/__init__.py similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/__init__.py rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/__init__.py diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/handlers.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/handlers.py similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/handlers.py rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/handlers.py diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/settings.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/settings.py similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/settings.py rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/settings.py diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/.gitignore b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/.gitignore similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/.gitignore rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/.gitignore diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/highlight.default.css b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/highlight.default.css similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/highlight.default.css rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/highlight.default.css diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/hightlight.default.css b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/hightlight.default.css similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/hightlight.default.css rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/hightlight.default.css diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/screen.css b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/screen.css similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/screen.css rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/screen.css diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/endpoint.html b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/endpoint.html similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/endpoint.html rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/endpoint.html diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/explorer_icons.png b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/explorer_icons.png similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/explorer_icons.png rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/explorer_icons.png diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/logo_small.png b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/logo_small.png similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/logo_small.png rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/logo_small.png diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/pet_store_api.png b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/pet_store_api.png similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/pet_store_api.png rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/pet_store_api.png diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/throbber.gif b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/throbber.gif similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/throbber.gif rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/throbber.gif diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/wordnik_api.png b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/wordnik_api.png similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/wordnik_api.png rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/wordnik_api.png diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/index.html b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/index.html similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/index.html rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/index.html diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/backbone-min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/backbone-min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/backbone-min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/backbone-min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/handlebars-1.0.0.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/handlebars-1.0.0.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/handlebars-1.0.0.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/handlebars-1.0.0.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/highlight.7.3.pack.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/highlight.7.3.pack.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/highlight.7.3.pack.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/highlight.7.3.pack.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery-1.8.0.min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery-1.8.0.min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery-1.8.0.min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery-1.8.0.min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.ba-bbq.min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.ba-bbq.min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.ba-bbq.min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.ba-bbq.min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.slideto.min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.slideto.min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.slideto.min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.slideto.min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.wiggle.min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.wiggle.min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.wiggle.min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.wiggle.min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred.bundle.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred.bundle.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred.bundle.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred.bundle.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred/content.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred/content.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred/content.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred/content.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger-oauth.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger-oauth.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger-oauth.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger-oauth.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/underscore-min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/underscore-min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/underscore-min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/underscore-min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/o2c.html b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/o2c.html similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/o2c.html rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/o2c.html diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.min.js b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.min.js similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.min.js rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.min.js diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/swagger.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/swagger.py similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/swagger.py rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/swagger.py diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/views.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger/views.py similarity index 100% rename from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/views.py rename to utils/test/result_collection_api/opnfv_testapi/tornado_swagger/views.py diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE deleted file mode 100644 index fbefeff74..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Ran Tavory - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README deleted file mode 100644 index 1bcc1145e..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README +++ /dev/null @@ -1 +0,0 @@ -Please see documentation here: https://github.com/SerenaFeng/tornado-swagger diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README.md b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README.md deleted file mode 100644 index e90e1309a..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README.md +++ /dev/null @@ -1,277 +0,0 @@ -# tornado-swagger - -## What is tornado-swagger? -tornado is a wrapper for tornado which enables swagger-ui support. - -In essense, you just need to wrap the Api instance and add a few python decorators to get full swagger support. - -## How to: -Install: - -``` -python setup.py install -``` -(This installs tornado and epydoc as well) - - -And in your program, where you'd usually just use tornado, add just a little bit of sauce and get a swagger spec out. - - -```python -from tornado.web import RequestHandler, HTTPError -from tornado_swagger import swagger - -swagger.docs() - -# You may decorate your operation with @swagger.operation and use docs to inform information -class ItemNoParamHandler(GenericApiHandler): - @swagger.operation(nickname='create') - def post(self): - """ - @param body: create test results for a item. - @type body: L{Item} - @return 200: item is created. - @raise 400: invalid input - """ - -# Operations not decorated with @swagger.operation do not get added to the swagger docs - -class ItemNoParamHandler(GenericApiHandler): - def options(self): - """ - I'm not visible in the swagger docs - """ - pass - - -# Then you use swagger.Application instead of tornado.web.Application -# and do other operations as usual - -def make_app(): - return swagger.Application([ - (r"/items", ItemNoParamHandler), - (r"/items/([^/]+)", ItemHandler), - (r"/items/([^/]+)/cases/([^/]+)", ItemOptionParamHandler), - ]) - -# You define models like this: -@swagger.model -class Item: - """ - @descriptin: - This is an example of a model class that has parameters in its constructor - and the fields in the swagger spec are derived from the parameters to __init__. - @notes: - In this case we would have property1, property2 as required parameters and property3 as optional parameter. - @property property3: Item decription - @ptype property3: L{PropertySubclass} - """ - def __init__(self, property1, property2=None): - self.property1 = property1 - self.property2 = property2 - -# Swagger json: - "models": { - "Item": { - "description": "A description...", - "id": "Item", - "required": [ - "property1", - ], - "properties": [ - "property1": { - "type": "string" - }, - "property2": { - "type": "string" - "default": null - } - ] - } - } - -# If you declare an __init__ method with meaningful arguments -# then those args could be used to deduce the swagger model fields. -# just as shown above - -# if you declare an @property in docs, this property property2 will also be used to deduce the swagger model fields -class Item: - """ - @property property3: Item description - """ - def __init__(self, property1, property2): - self.property1 = property1 - self.property2 = property2 - -# Swagger json: - "models": { - "Item": { - "description": "A description...", - "id": "Item", - "required": [ - "property1", - ], - "properties": [ - "property1": { - "type": "string" - }, - "property2": { - "type": "string" - } - "property3": { - "type": "string" - } - ] - } - } - -# if you declare an argument with @ptype, the type of this argument will be specified rather than the default 'string' -class Item: - """ - @ptype property3: L{PropertySubclass} - """ - def __init__(self, property1, property2, property3=None): - self.property1 = property1 - self.property2 = property2 - self.property3 = property3 - -# Swagger json: - "models": { - "Item": { - "description": "A description...", - "id": "Item", - "required": [ - "property1", - ], - "properties": [ - "property1": { - "type": "string" - }, - "property2": { - "type": "string" - }, - "property3": { - "type": "PropertySubclass" - "default": null - } - ] - } - } - -# if you want to declare an list property, you can do it like this: -class Item: - """ - @ptype property3: L{PropertySubclass} - @ptype property4: C{list} of L{PropertySubclass} - """ - def __init__(self, property1, property2, property3, property4=None): - self.property1 = property1 - self.property2 = property2 - self.property3 = property3 - self.property4 = property4 - -# Swagger json: - "models": { - "Item": { - "description": "A description...", - "id": "Item", - "required": [ - "property1", - ], - "properties": [ - "property1": { - "type": "string" - }, - "property2": { - "type": "string" - }, - "property3": { - "type": "PropertySubclass" - "default": null - }, - "property4": { - "default": null, - "items": { - "type": "PropertySubclass"}, - "type": "array" - } - } - ] - } - } - -# if it is a query: -class ItemQueryHandler(GenericApiHandler): - @swagger.operation(nickname='query') - def get(self): - """ - @param property1: - @type property1: L{string} - @in property1: query - @required property1: False - - @param property2: - @type property2: L{string} - @in property2: query - @required property2: True - @rtype: L{Item} - - @notes: GET /item?property1=1&property2=1 - """ - -# Swagger json: - "apis": [ - { - "operations": [ - { - "parameters": [ - { - "name": "property1", - "dataType": "string", - "paramType": "query", - "description": "" - }, - { - "name": "property2", - "dataType": "string", - "paramType": "query", - "required": true, - "description": "" - } - ], - "responseClass": "Item", - "notes": null, - "responseMessages": [], - "summary": null, - "httpMethod": "GET", - "nickname": "query" - } - ], - "path": "/item", - "description": null - }, - .... - ] -``` - -# Running and testing - -Now run your tornado app - -``` -python basic.py -``` - -And visit: - -``` -curl http://localhost:711/swagger/spec -``` - -access to web -``` -http://localhost:711/swagger/spec.html -``` - -# Passing more metadata to swagger -customized arguments used in creating the 'swagger.docs' object will be supported later diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/example/basic.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/example/basic.py deleted file mode 100644 index 93ff00b43..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/example/basic.py +++ /dev/null @@ -1,219 +0,0 @@ -import json - -import tornado.ioloop -from tornado.web import RequestHandler, HTTPError -from tornado_swagger_ui.tornado_swagger import swagger - -DEFAULT_REPRESENTATION = "application/json" -HTTP_BAD_REQUEST = 400 -HTTP_FORBIDDEN = 403 -HTTP_NOT_FOUND = 404 - -swagger.docs() - - -@swagger.model() -class PropertySubclass: - def __init__(self, sub_property=None): - self.sub_property = sub_property - - -@swagger.model() -class Item: - """ - @description: - This is an example of a model class that has parameters in its - constructor and the fields in the swagger spec are derived from - the parameters to __init__. - @notes: - In this case we would have property1, name as required parameters - and property3 as optional parameter. - @property property3: Item description - @ptype property3: L{PropertySubclass} - @ptype property4: C{list} of L{PropertySubclass} - """ - def __init__(self, - property1, - property2=None, - property3=None, - property4=None): - self.property1 = property1 - self.property2 = property2 - self.property3 = property3 - self.property4 = property4 - - def format_http(self): - return { - "property1": self.property1, - "property2": self.property2, - "property3": self.property3, - "property4": self.property4, - } - - @staticmethod - def item_from_dict(item_dict): - - if item_dict is None: - return None - - t = Item(None) - t.property1 = item_dict.get('property1') - t.property2 = item_dict.get('property2') - t.property3 = item_dict.get('property3') - t.property4 = item_dict.get('property4') - - return t - - @classmethod - def test_classmethod(cls): - pass - - -items = {} - - -class GenericApiHandler(RequestHandler): - """ - The purpose of this class is to take benefit of inheritance and prepare - a set of common functions for - the handlers - """ - - def initialize(self): - """ Prepares the database for the entire class """ - pass - - def prepare(self): - if self.request.method != "GET" and self.request.method != "DELETE": - self.json_args = None - content_type = self.request.headers.get("Content-Type") - if content_type is not None: - if content_type.startswith(DEFAULT_REPRESENTATION): - try: - self.json_args = json.loads(self.request.body) - except (ValueError, KeyError, TypeError) as error: - raise HTTPError(HTTP_BAD_REQUEST, - "Bad Json format [{}]". - format(error)) - - def finish_request(self, json_object): - self.write(json.dumps(json_object)) - self.set_header("Content-Type", DEFAULT_REPRESENTATION) - self.finish() - - -class ItemNoParamHandler(GenericApiHandler): - @swagger.operation(nickname='create') - def post(self): - """ - @param body: create a item. - @type body: L{Item} - @in body: body - @return 200: item is created. - @raise 400: invalid input - """ - property1 = self.json_args.get('property1') - item = Item.item_from_dict(self.json_args) - items[property1] = item - Item.test_classmethod() - self.finish_request(item.format_http()) - - @swagger.operation(nickname='list') - def get(self): - """ - @rtype: L{Item} - """ - res = [] - for key, value in items.iteritems(): - res.append(value.format_http()) - self.finish_request(res) - - def options(self): - """ - I'm not visible in the swagger docs - """ - self.finish_request("I'm invisible in the swagger docs") - - -class ItemHandler(GenericApiHandler): - @swagger.operation(nickname='get') - def get(self, arg): - """ - @rtype: L{Item} - @description: get information of a item - @notes: - get a item, - - This will be added to the Implementation Notes. - It lets you put very long text in your api. - """ - self.finish_request(items[arg].format_http()) - - @swagger.operation(nickname='delete') - def delete(self, arg): - """ - @description: delete a item - @notes: - delete a item in items - """ - del items[arg] - self.finish_request("success") - - -class ItemOptionParamHandler(GenericApiHandler): - @swagger.operation(nickname='create') - def post(self, arg1, arg2=''): - """ - @return 200: case is created - """ - fs = open("/home/%s/%s" % (arg1, arg2), "wb") - fs.write(self.request.body) - self.write("success") - - -class ItemQueryHandler(GenericApiHandler): - @swagger.operation(nickname='query') - def get(self): - """ - @param property1: - @type property1: L{string} - @in property1: query - @required property1: False - - @param property2: - @type property2: L{string} - @in property2: query - @required property2: True - @rtype: L{Item} - @notes: GET /item?property1=1&property2=1 - """ - property1 = self.get_query_argument("property1", None) - property2 = self.get_query_argument("property2", None) - - res = [] - if property1 is None: - for key, value in items.iteritems(): - if property2 is None: - res.append(value.format_http()) - elif value.property2 == property2: - res.append(value.format_http()) - elif property1 in items: - if items.get(property1).property2 == property2: - res.append(items.get(property1).format_http()) - - self.finish_request(res) - - -def make_app(): - return swagger.Application([ - (r"/item", ItemQueryHandler), - (r"/items", ItemNoParamHandler), - (r"/items/([^/]+)", ItemHandler), - (r"/items/([^/]+)/cases/([^/]+)", ItemOptionParamHandler), - ]) - - -if __name__ == "__main__": - app = make_app() - app.listen(711) - tornado.ioloop.IOLoop.current().start() diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/setup.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/setup.py deleted file mode 100644 index 57dc48a9a..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -with open('README') as f: - long_description = f.read() - -setup(name='tornado-swagger', - version='1.0', - url='https://github.com/SerenaFeng/tornado-swagger', - zip_safe=False, - packages=['tornado_swagger'], - package_data={ - 'tornado_swagger': [ - 'static/*.*', - 'static/css/*.*', - 'static/images/*.*', - 'static/lib/*.*', - 'static/lib/shred/*.*' - ] - }, - description='Extract swagger specs from your tornado project', - author='Serena Feng', - license='MIT', - long_description=long_description, - install_requires=[ - 'tornado>=3.1', - 'epydoc>=0.3.1' - ]) diff --git a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/__init__.py b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/__init__.py deleted file mode 100644 index 031a4a20e..000000000 --- a/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -__author__ = 'serena' diff --git a/utils/test/result_collection_api/setup.cfg b/utils/test/result_collection_api/setup.cfg index 702a41fc0..927957ac7 100644 --- a/utils/test/result_collection_api/setup.cfg +++ b/utils/test/result_collection_api/setup.cfg @@ -25,11 +25,11 @@ packages = opnfv_testapi package_data = opnfv_testapi = - tornado_swagger_ui/tornado_swagger/static/*.* - tornado_swagger_ui/tornado_swagger/static/css/*.* - tornado_swagger_ui/tornado_swagger/static/images/*.* - tornado_swagger_ui/tornado_swagger/static/lib/*.* - tornado_swagger_ui/tornado_swagger/static/lib/shred/*.* + tornado_swagger/static/*.* + tornado_swagger/static/css/*.* + tornado_swagger/static/images/*.* + tornado_swagger/static/lib/*.* + tornado_swagger/static/lib/shred/*.* data_files = /etc/opnfv_testapi = etc/config.ini -- 2.16.6