def test_sort_dict_by_custom_order(self): self.assertEqual( list( utils.sort_dict_by_custom_order( {"C": 3, "D": 2, "A": 1, "B": 8}, ["A", "D"] ).keys() ), ["A", "D", "C", "B"], )
def sort_step_by_custom_order(step: Dict) -> Dict: custom_order = [ "name", "variables", "request", "testcase", "setup_hooks", "teardown_hooks", "extract", "validate", "validate_script", ] return sort_dict_by_custom_order(step, custom_order)
def sort_request_by_custom_order(request: Dict) -> Dict: custom_order = [ "method", "url", "params", "headers", "cookies", "data", "json", "files", "timeout", "allow_redirects", "proxies", "verify", "stream", "auth", "cert", ] return sort_dict_by_custom_order(request, custom_order)