rename TestcaseParser argument name: functions_binds => functions

This commit is contained in:
debugtalk
2017-10-24 16:08:09 +08:00
parent 1d0177dd09
commit fd8592eb68
2 changed files with 14 additions and 14 deletions

View File

@@ -329,9 +329,9 @@ def substitute_variables_with_mapping(content, mapping):
class TestcaseParser(object):
def __init__(self, variables={}, functions_binds={}, file_path=None):
def __init__(self, variables={}, functions={}, file_path=None):
self.bind_variables(variables)
self.bind_functions(functions_binds)
self.bind_functions(functions)
self.file_path = file_path
def bind_variables(self, variables):
@@ -346,19 +346,19 @@ class TestcaseParser(object):
"""
self.variables = variables
def bind_functions(self, functions_binds):
def bind_functions(self, functions):
""" bind functions to current testcase parser
@param (dict) functions_binds, functions binds mapping
@param (dict) functions, functions binds mapping
{
"add_two_nums": lambda a, b=1: a + b
}
"""
self.functions_binds = functions_binds
self.functions = functions
def get_bind_item(self, item_type, item_name):
if item_type == "function":
if item_name in self.functions_binds:
return self.functions_binds[item_name]
if item_name in self.functions:
return self.functions[item_name]
elif item_type == "variable":
if item_name in self.variables:
return self.variables[item_name]