mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-14 20:08:23 +08:00
make variables marker unified to be
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
-
|
||||
variable_binds:
|
||||
- TOKEN: "debugtalk"
|
||||
- token: $TOKEN
|
||||
- token: ${TOKEN}
|
||||
|
||||
-
|
||||
function_binds:
|
||||
@@ -35,4 +35,4 @@
|
||||
- TOKEN: debugtalk
|
||||
- random: {"func": "gen_random_string", "args": [5]}
|
||||
- data: "{'name': 'user', 'password': '123456'}"
|
||||
- authorization: {"func": "gen_md5", "args": [$TOKEN, $data, $random]}
|
||||
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${data}", "${random}"]}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
- TOKEN: debugtalk
|
||||
- random: {"func": "gen_random_string", "args": [5]}
|
||||
- data: '{"name": "user", "password": "123456"}'
|
||||
- authorization: {"func": "gen_md5", "args": ["$TOKEN", "$data", "$random"]}
|
||||
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${data}", "${random}"]}
|
||||
- expected_status_code: 201
|
||||
request:
|
||||
url: http://127.0.0.1:5000/api/users/1000
|
||||
@@ -43,7 +43,7 @@
|
||||
- TOKEN: debugtalk
|
||||
- random: {"func": "gen_random_string", "args": [5]}
|
||||
- data: '{"name": "user", "password": "123456"}'
|
||||
- authorization: {"func": "gen_md5", "args": ["$TOKEN", "$data", "$random"]}
|
||||
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${data}", "${random}"]}
|
||||
- expected_status_code: 500
|
||||
request:
|
||||
url: http://127.0.0.1:5000/api/users/1000
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
- TOKEN: debugtalk
|
||||
- random: {"func": "gen_random_string", "args": [5]}
|
||||
- data: '{"name": "user", "password": "123456"}'
|
||||
- authorization: {"func": "gen_md5", "args": ["$TOKEN", "$data", "$random"]}
|
||||
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${data}", "${random}"]}
|
||||
|
||||
- test:
|
||||
name: create user which does not exist
|
||||
|
||||
@@ -69,7 +69,7 @@ class VariableBindsUnittest(unittest.TestCase):
|
||||
testcase1 = {
|
||||
"variable_binds": [
|
||||
{"GLOBAL_TOKEN": "debugtalk"},
|
||||
{"token": "$GLOBAL_TOKEN"}
|
||||
{"token": "${GLOBAL_TOKEN}"}
|
||||
]
|
||||
}
|
||||
testcase2 = self.testcases[3]
|
||||
|
||||
Reference in New Issue
Block a user