change the usage of tornado_swagger package 53/14953/4
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Wed, 1 Jun 2016 09:36:45 +0000 (17:36 +0800)
committerSerena Feng <feng.xiaowei@zte.com.cn>
Wed, 1 Jun 2016 13:42:01 +0000 (13:42 +0000)
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 <feng.xiaowei@zte.com.cn>
50 files changed:
utils/test/result_collection_api/opnfv_testapi/cmd/server.py
utils/test/result_collection_api/opnfv_testapi/resources/dashboard_handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/models.py
utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py
utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/project_models.py
utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/result_models.py
utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py
utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/__init__.py with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/handlers.py with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/settings.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/settings.py with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/.gitignore [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/.gitignore with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/highlight.default.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/highlight.default.css with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/hightlight.default.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/hightlight.default.css with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/screen.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/css/screen.css with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/endpoint.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/endpoint.html with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/explorer_icons.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/explorer_icons.png with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/logo_small.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/logo_small.png with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/pet_store_api.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/pet_store_api.png with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/throbber.gif [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/throbber.gif with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/wordnik_api.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/images/wordnik_api.png with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/index.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/index.html with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/backbone-min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/backbone-min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/handlebars-1.0.0.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/handlebars-1.0.0.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/highlight.7.3.pack.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/highlight.7.3.pack.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery-1.8.0.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery-1.8.0.min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.ba-bbq.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.ba-bbq.min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.slideto.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.slideto.min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.wiggle.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/jquery.wiggle.min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred.bundle.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred.bundle.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred/content.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/shred/content.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger-oauth.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger-oauth.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/swagger.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/underscore-min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/lib/underscore-min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/o2c.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/o2c.html with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/static/swagger-ui.min.js with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/swagger.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/swagger.py with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger/views.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/views.py with 100% similarity]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE [deleted file]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README [deleted file]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/README.md [deleted file]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/example/basic.py [deleted file]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/setup.py [deleted file]
utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/tornado_swagger/__init__.py [deleted file]
utils/test/result_collection_api/setup.cfg

index 1031fbb..9022b9a 100644 (file)
@@ -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
index 00abbb9..82bf8d2 100644 (file)
@@ -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):
index 4b39b24..3d39502 100644 (file)
@@ -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):
index 881f65d..290a7f3 100644 (file)
@@ -13,7 +13,7 @@
 # feng.xiaowei@zte.com.cn  mv TestCase to testcase_models.py       5-20-2016\r
 # feng.xiaowei@zte.com.cn  mv TestResut to result_models.py        5-23-2016\r
 ##############################################################################\r
-from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger\r
+from opnfv_testapi.tornado_swagger import swagger\r
 \r
 \r
 class CreateResponse(object):\r
index 5a4b555..d9e6686 100644 (file)
@@ -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
index 2e64503..3e6f5a8 100644 (file)
@@ -1,4 +1,4 @@
-from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger
+from opnfv_testapi.tornado_swagger import swagger
 
 __author__ = '__serena__'
 
index 191a933..30fb402 100644 (file)
@@ -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
index fbb6beb..1014254 100644 (file)
@@ -1,4 +1,4 @@
-from opnfv_testapi.tornado_swagger_ui.tornado_swagger import swagger
+from opnfv_testapi.tornado_swagger import swagger
 
 __author__ = '__serena__'
 
index a9aa17b..9358c71 100644 (file)
@@ -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):
index dbeebeb..4b825f2 100644 (file)
@@ -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):
index aa5789e..e3718a6 100644 (file)
@@ -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/LICENSE b/utils/test/result_collection_api/opnfv_testapi/tornado_swagger_ui/LICENSE
deleted file mode 100644 (file)
index fbefeff..0000000
+++ /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 (file)
index 1bcc114..0000000
+++ /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 (file)
index e90e130..0000000
+++ /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 (file)
index 93ff00b..0000000
+++ /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 (file)
index 57dc48a..0000000
+++ /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 (file)
index 031a4a2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-__author__ = 'serena'
index 702a41f..927957a 100644 (file)
@@ -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