summaryrefslogtreecommitdiffstats
path: root/result_collection_api/opnfv_testapi/resources/result_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'result_collection_api/opnfv_testapi/resources/result_models.py')
-rw-r--r--result_collection_api/opnfv_testapi/resources/result_models.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/result_collection_api/opnfv_testapi/resources/result_models.py b/result_collection_api/opnfv_testapi/resources/result_models.py
index dd1e3dc..f73f5c6 100644
--- a/result_collection_api/opnfv_testapi/resources/result_models.py
+++ b/result_collection_api/opnfv_testapi/resources/result_models.py
@@ -55,15 +55,14 @@ class TI(object):
@staticmethod
def from_dict(a_dict):
- if a_dict is None:
- return None
t = TI()
- t.current = a_dict.get('current')
- if 'histories' in a_dict.keys():
- for history in a_dict.get('histories', None):
- t.histories.append(TIHistory.from_dict(history))
- else:
- t.histories = []
+ if a_dict:
+ t.current = a_dict.get('current')
+ if 'histories' in a_dict.keys():
+ for history in a_dict.get('histories', None):
+ t.histories.append(TIHistory.from_dict(history))
+ else:
+ t.histories = []
return t
@@ -97,7 +96,7 @@ class ResultCreateRequest(object):
self.build_tag = build_tag
self.scenario = scenario
self.criteria = criteria
- self.trust_indicator = trust_indicator
+ self.trust_indicator = trust_indicator if trust_indicator else TI(0)
def format(self):
return {