mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 14:29:44 +08:00
fix commit 4cf2a17cd0
This commit is contained in:
@@ -34,14 +34,14 @@ class SessionContext(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.test_variables_mapping = {}
|
self.test_variables_mapping = {}
|
||||||
|
self.test_variables_mapping.update(self.session_variables_mapping)
|
||||||
|
|
||||||
variables_mapping = variables_mapping or {}
|
variables_mapping = variables_mapping or {}
|
||||||
variables_mapping = utils.ensure_mapping_format(variables_mapping)
|
variables_mapping = utils.ensure_mapping_format(variables_mapping)
|
||||||
for variable_name, variable_value in variables_mapping.items():
|
for variable_name, variable_value in variables_mapping.items():
|
||||||
variable_value = self.eval_content(variable_value)
|
variable_value = self.eval_content(variable_value)
|
||||||
self.update_test_variables(variable_name, variable_value)
|
self.update_test_variables(variable_name, variable_value)
|
||||||
|
|
||||||
self.test_variables_mapping.update(self.session_variables_mapping)
|
|
||||||
|
|
||||||
def update_test_variables(self, variable_name, variable_value):
|
def update_test_variables(self, variable_name, variable_value):
|
||||||
""" update test variables, these variables are only valid in the current test.
|
""" update test variables, these variables are only valid in the current test.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
id: create_and_check
|
id: create_and_check
|
||||||
variables:
|
variables:
|
||||||
- uid: 9001
|
- uid: 9001
|
||||||
- token: XXX
|
|
||||||
- device_sn: "TESTCASE_CREATE_XXX"
|
- device_sn: "TESTCASE_CREATE_XXX"
|
||||||
base_url: "http://127.0.0.1:5000"
|
base_url: "http://127.0.0.1:5000"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user