summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/resources/project_models.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-26 20:32:02 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-26 20:40:13 +0800
commit5362ddab5a739f5198d3e7918b6059c27a4eac09 (patch)
treeb46c54b17c561cf051bf79717b3a24c8eb138b5a /utils/test/result_collection_api/resources/project_models.py
parent00355a8df9949edc12c41d5a8475fc17efbb03d3 (diff)
swagger-ize project-apis of testAPI
rename pod_handler.py to pod_handlers.py JIRA: FUNCTEST-264 Change-Id: I8699999776bdb238f680a128b83cea0a098534c5 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/resources/project_models.py')
-rw-r--r--utils/test/result_collection_api/resources/project_models.py34
1 files changed, 27 insertions, 7 deletions
diff --git a/utils/test/result_collection_api/resources/project_models.py b/utils/test/result_collection_api/resources/project_models.py
index 895fc3e5e..a8f830932 100644
--- a/utils/test/result_collection_api/resources/project_models.py
+++ b/utils/test/result_collection_api/resources/project_models.py
@@ -1,7 +1,23 @@
+from tornado_swagger_ui.tornado_swagger import swagger
+
__author__ = '__serena__'
+@swagger.model()
class ProjectCreateRequest(object):
+ def __init__(self, name, description=''):
+ self.name = name
+ self.description = description
+
+ def format(self):
+ return {
+ "name": self.name,
+ "description": self.description,
+ }
+
+
+@swagger.model()
+class ProjectUpdateRequest(object):
def __init__(self, name='', description=''):
self.name = name
self.description = description
@@ -13,14 +29,14 @@ class ProjectCreateRequest(object):
}
+@swagger.model()
class Project:
- """ Describes a test project"""
-
- def __init__(self):
- self._id = None
- self.name = None
- self.description = None
- self.creation_date = None
+ def __init__(self,
+ name=None, _id=None, description=None, create_date=None):
+ self._id = _id
+ self.name = name
+ self.description = description
+ self.creation_date = create_date
@staticmethod
def from_dict(res_dict):
@@ -52,7 +68,11 @@ class Project:
}
+@swagger.model()
class Projects(object):
+ """
+ @ptype projects: C{list} of L{Project}
+ """
def __init__(self, projects=list()):
self.projects = projects