Merge pull request #14 from diaojunxian/master

bugfix: add maxreplace=1 to avoid similar variables are replaced by mistaken.
For instance, if user=1000, then "/$user/$userid" will be replaced to be "/1000/1000id".
This commit is contained in:
httprunner
2017-08-03 13:34:29 +08:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ def parse_variables(content, variable_mapping):
# content contains one or many variables
content = content.replace(
"${}".format(variable_name),
str(variable_value)
str(variable_value), 1
)
return content