MCPcopy Index your code
hub / github.com/httprunner/httprunner / get_mapping_variable

Function get_mapping_variable

httprunner/parser.py:221–243  ·  view source on GitHub ↗

get variable from variables_mapping. Args: variable_name (str): variable name variables_mapping (dict): variables mapping Returns: mapping variable value. Raises: exceptions.VariableNotFound: variable is not found.

(
    variable_name: Text, variables_mapping: VariablesMapping
)

Source from the content-addressed store, hash-verified

219
220
221def get_mapping_variable(
222 variable_name: Text, variables_mapping: VariablesMapping
223) -> Any:
224 """get variable from variables_mapping.
225
226 Args:
227 variable_name (str): variable name
228 variables_mapping (dict): variables mapping
229
230 Returns:
231 mapping variable value.
232
233 Raises:
234 exceptions.VariableNotFound: variable is not found.
235
236 """
237 # TODO: get variable from debugtalk module and environ
238 try:
239 return variables_mapping[variable_name]
240 except KeyError:
241 raise exceptions.VariableNotFound(
242 f"{variable_name} not found in {variables_mapping}"
243 )
244
245
246def get_mapping_function(

Callers 1

parse_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected