Example #1
0
 def _set_value(self, new_value):
     if isinstance(new_value, datetime.datetime):
         new_value = datetime_extension.to_json(new_value)
     if isinstance(new_value, datetime.timedelta):
         new_value = timedelta_extension.to_json(new_value)
     super(JSONDocumentFragment, self)._set_value(new_value)
Example #2
0
 def postprocess_test_result(self, test_result, data):
     delta = datetime.timedelta(seconds=data['endtime'] - data['starttime'])
     test_result['duration'] = timedelta_extension.to_json(delta)
 def _set_value(self, new_value):
     if isinstance(new_value, datetime.datetime):
         new_value = datetime_extension.to_json(new_value)
     if isinstance(new_value, datetime.timedelta):
         new_value = timedelta_extension.to_json(new_value)
     super(JSONDocumentFragment, self)._set_value(new_value)
 def postprocess_test_result(self, test_result, data):
     delta = datetime.timedelta(seconds=data['endtime'] - data['starttime'])
     test_result['duration'] = timedelta_extension.to_json(delta)