summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/resources/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/result_collection_api/resources/models.py')
-rw-r--r--utils/test/result_collection_api/resources/models.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/utils/test/result_collection_api/resources/models.py b/utils/test/result_collection_api/resources/models.py
index 82c17fda3..3b4d843f3 100644
--- a/utils/test/result_collection_api/resources/models.py
+++ b/utils/test/result_collection_api/resources/models.py
@@ -22,13 +22,19 @@ class Pod:
p = Pod()
p._id = pod_dict.get('_id')
- p.creation_date = pod_dict.get('creation_date')
+ p.creation_date = str(pod_dict.get('creation_date'))
p.name = pod_dict.get('name')
return p
def format(self):
return {
- "_id": self._id,
+ "name": self.name,
+ "creation_date": str(self.creation_date),
+ }
+
+ def format_http(self):
+ return {
+ "_id": str(self._id),
"name": self.name,
"creation_date": str(self.creation_date),
}
@@ -82,6 +88,7 @@ class TestCase:
self.name = None
self.project_name = None
self.description = None
+ self.url = None
self.creation_date = None
@staticmethod
@@ -96,6 +103,7 @@ class TestCase:
t.creation_date = testcase_dict.get('creation_date')
t.name = testcase_dict.get('name')
t.description = testcase_dict.get('description')
+ t.url = testcase_dict.get('url')
return t
@@ -104,7 +112,8 @@ class TestCase:
"name": self.name,
"description": self.description,
"project_name": self.project_name,
- "creation_date": str(self.creation_date)
+ "creation_date": str(self.creation_date),
+ "url": self.url
}
def format_http(self, test_project=None):
@@ -113,6 +122,7 @@ class TestCase:
"name": self.name,
"description": self.description,
"creation_date": str(self.creation_date),
+ "url": self.url,
}
if test_project is not None:
res["test_project"] = test_project
@@ -127,9 +137,9 @@ class TestResult:
self._id = None
self.case_name = None
self.project_name = None
- self.pod_id = None
+ self.pod_name = None
self.installer = None
- self.platform_version = None
+ self.version = None
self.description = None
self.creation_date = None
self.details = None
@@ -143,11 +153,13 @@ class TestResult:
t = TestResult()
t._id = test_result_dict.get('_id')
t.case_name = test_result_dict.get('case_name')
+ t.pod_name = test_result_dict.get('pod_name')
t.project_name = test_result_dict.get('project_name')
- t.pod_id = test_result_dict.get('pod_id')
t.description = test_result_dict.get('description')
t.creation_date = str(test_result_dict.get('creation_date'))
t.details = test_result_dict.get('details')
+ t.version = test_result_dict.get('version')
+ t.installer = test_result_dict.get('installer')
return t
@@ -155,9 +167,11 @@ class TestResult:
return {
"case_name": self.case_name,
"project_name": self.project_name,
- "pod_id": self.pod_id,
+ "pod_name": self.pod_name,
"description": self.description,
"creation_date": str(self.creation_date),
+ "version": self.version,
+ "installer": self.installer,
"details": self.details,
}
@@ -166,8 +180,10 @@ class TestResult:
"_id": str(self._id),
"case_name": self.case_name,
"project_name": self.project_name,
- "pod_id": self.pod_id,
+ "pod_name": self.pod_name,
"description": self.description,
"creation_date": str(self.creation_date),
+ "version": self.version,
+ "installer": self.installer,
"details": self.details,
}