def get_aggregate_results(self): passed, error = 0, 0 positive, negative = 0, 0 for call in self.get_json_obj(): success = True if not postman.get_call_result(call): success = False if 'testScript' in call: for script in call['testScript']: if 'error' in script: error += 1 success = False if 'assertions' in call: for assertion in call['assertions']: if 'error' in assertion: error += 1 success = False else: passed += 1 if success: positive += 1 else: negative += 1 return { 'assertions': { 'passed': passed, 'failed': error, 'total': error + passed }, 'calls': { 'success': positive, 'failed': negative, 'total': negative + positive } }
def get_call_results(self): positive, negative = 0, 0 for call in self.get_json_obj(): if postman.get_call_result(call): positive += 1 else: negative += 1 return positive, negative
def get_call_results_list(self): return [postman.get_call_result(call) for call in self.get_json_obj()]