MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / get_scenario_name

Function get_scenario_name

web/regression/python_test_utils/test_utils.py:1128–1152  ·  view source on GitHub ↗

This function filters the test cases from list of test cases and returns the test cases list :param cases: test cases :type cases: dict :return: test cases in dict :rtype: dict

(cases)

Source from the content-addressed store, hash-verified

1126
1127
1128def get_scenario_name(cases):
1129 """
1130 This function filters the test cases from list of test cases and returns
1131 the test cases list
1132 :param cases: test cases
1133 :type cases: dict
1134 :return: test cases in dict
1135 :rtype: dict
1136 """
1137 test_cases_dict = {}
1138 test_cases_dict_json = {}
1139 for class_name, test_case_list in cases.items():
1140 result = {class_name: []}
1141 for case_name_dict in test_case_list:
1142 key, _ = list(case_name_dict.items())[0]
1143 class_names_dict = dict(
1144 (c_name, "") for scenario in result[class_name] for
1145 c_name in scenario.keys())
1146 if key not in class_names_dict:
1147 result[class_name].append(case_name_dict)
1148 test_cases_dict_json.update(result)
1149 test_cases_list = list(dict((case, "") for test_case in test_case_list
1150 for case in test_case))
1151 test_cases_dict.update({class_name: test_cases_list})
1152 return test_cases_dict, test_cases_dict_json
1153
1154
1155class Database:

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected