#NEWLINE# def _compare( self , tc1 , tc2 ) : #NEWLINE# #INDENT# 'Compare two verification results.\n\n        :param tc1: first verification test cases json\n        :param tc2: second verification test cases json\n\n        Typical test case json schema:\n            "test_case_key": {\n                "traceback": "", # exists only for "fail" status\n                "reason": "",    # exists only for "skip" status\n                "name": "",\n                "status": "",\n                "time": 0.0\n            }\n        ' #NEWLINE# diffs = [ ] #NEWLINE# names1 = set ( tc1 . keys ( ) ) #NEWLINE# names2 = set ( tc2 . keys ( ) ) #NEWLINE# common_tests = list ( names1 . intersection ( names2 ) ) #NEWLINE# removed_tests = list ( names1 . difference ( common_tests ) ) #NEWLINE# new_tests = list ( names2 . difference ( common_tests ) ) #NEWLINE# for name in removed_tests : #NEWLINE# #INDENT# diffs . append ( { #NEWLINE# #INDENT# 'type' : 'removed_test' , #NEWLINE# 'test_name' : name , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for name in new_tests : #NEWLINE# #INDENT# diffs . append ( { #NEWLINE# #INDENT# 'type' : 'new_test' , #NEWLINE# 'test_name' : name , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for name in common_tests : #NEWLINE# #INDENT# diffs . extend ( self . _diff_values ( name , tc1 [ name ] , tc2 [ name ] ) ) #NEWLINE# #UNINDENT# return diffs