summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/resources/result_models.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-31 10:37:22 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-31 11:18:07 +0800
commitf3235be772439981fa9e0f781b4e130b0860dad0 (patch)
tree21ff5de2addcf54c4bb484dac6cca6f482c0e8a6 /utils/test/result_collection_api/resources/result_models.py
parentb52a9ae338f95e710e5f55c85f406900b9954677 (diff)
bugfix: query results failed due to using mutable list initiation
and forget to swagger-ize TestResult model JIRA: FUNCTEST-277 Change-Id: I5d8ddd9983484a61df9b77392d5ae24bde6a16dc Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/resources/result_models.py')
-rw-r--r--utils/test/result_collection_api/resources/result_models.py39
1 files changed, 22 insertions, 17 deletions
diff --git a/utils/test/result_collection_api/resources/result_models.py b/utils/test/result_collection_api/resources/result_models.py
index 7faac16d4..27c354220 100644
--- a/utils/test/result_collection_api/resources/result_models.py
+++ b/utils/test/result_collection_api/resources/result_models.py
@@ -48,20 +48,24 @@ class ResultCreateRequest(object):
@swagger.model()
class TestResult(object):
- def __init__(self):
- self._id = None
- self.case_name = None
- self.project_name = None
- self.pod_name = None
- self.installer = None
- self.version = None
- self.start_date = None
- self.stop_date = None
- self.details = None
- self.build_tag = None
- self.scenario = None
- self.criteria = None
- self.trust_indicator = None
+ def __init__(self, _id=None, case_name=None, project_name=None,
+ pod_name=None, installer=None, version=None,
+ start_date=None, stop_date=None, details=None,
+ build_tag=None, scenario=None, criteria=None,
+ trust_indicator=None):
+ self._id = _id
+ self.case_name = case_name
+ self.project_name = project_name
+ self.pod_name = pod_name
+ self.installer = installer
+ self.version = version
+ self.start_date = start_date
+ self.stop_date = stop_date
+ self.details = details
+ self.build_tag = build_tag
+ self.scenario = scenario
+ self.criteria = criteria
+ self.trust_indicator = trust_indicator
@staticmethod
def from_dict(a_dict):
@@ -137,10 +141,11 @@ class TestResult(object):
@swagger.model()
class TestResults(object):
"""
- @ptype testcases: C{list} of L{TestResult}
+ @property results:
+ @ptype results: C{list} of L{TestResult}
"""
- def __init__(self, results=list()):
- self.results = results
+ def __init__(self):
+ self.results = list()
@staticmethod
def from_dict(a_dict):