change variable marker and function marker:

1, variable marker: ${var} => $var;
2, function marker: {'func': 'gen_random_string', 'args': [5]} => ${gen_random_string(5).
This commit is contained in:
httprunner
2017-07-04 16:45:01 +08:00
parent d941f3a3d5
commit 17bf07f012
11 changed files with 152 additions and 138 deletions

View File

@@ -10,8 +10,8 @@
variable_binds:
- TOKEN: debugtalk
- data: ""
- random: {"func": "gen_random_string", "args": [5]}
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${data}", "${random}"]}
- random: ${gen_random_string(5)}
- authorization: ${gen_md5($TOKEN, $data, $random)}
request:
base_url: http://127.0.0.1:5000
@@ -24,9 +24,9 @@
method: POST
headers:
Content-Type: application/json
authorization: "${authorization}"
random: "${random}"
data: "${data}"
authorization: $authorization
random: $random
data: $data
validators:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
@@ -41,9 +41,9 @@
method: POST
headers:
Content-Type: application/json
authorization: "${authorization}"
random: "${random}"
data: "${data}"
authorization: $authorization
random: $random
data: $data
validators:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}