diff --git a/lyrebird/mock/handlers/function_executor.py b/lyrebird/mock/handlers/function_executor.py index 879780137..6e80688c5 100644 --- a/lyrebird/mock/handlers/function_executor.py +++ b/lyrebird/mock/handlers/function_executor.py @@ -1,6 +1,7 @@ import re import traceback from lyrebird.log import get_logger +from lyrebird.utils import HookedDict logger = get_logger() @@ -28,6 +29,8 @@ def func_handler(func_list, flow, handler_type='flow_editor'): @staticmethod def get_matched_sorted_handler(func_list, flow): matched_func = [] + if not isinstance(flow, HookedDict): + flow = HookedDict(flow) for func in func_list: rules = func['rules'] if not rules or FunctionExecutor._is_req_match_rule(rules, flow):