mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 22:39:42 +08:00
fix: unittest
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
"name": "demo with complex mechanisms",
|
||||
"base_url": "https://postman-echo.com",
|
||||
"variables": {
|
||||
"a": "${Sum(10, 2.3)}",
|
||||
"a": "${sum(10, 2.3)}",
|
||||
"b": 3.45,
|
||||
"n": "${SumInts(1, 2, 2)}",
|
||||
"n": "${sum_ints(1, 2, 2)}",
|
||||
"varFoo1": "${gen_random_string($n)}",
|
||||
"varFoo2": "${max($a, $b)}"
|
||||
}
|
||||
@@ -38,10 +38,10 @@
|
||||
"varFoo2": "${max($a, $b)}"
|
||||
},
|
||||
"setup_hooks": [
|
||||
"${SetupHookExample($name)}"
|
||||
"${setup_hook_example($name)}"
|
||||
],
|
||||
"teardown_hooks": [
|
||||
"${TeardownHookExample($name)}"
|
||||
"${teardown_hook_example($name)}"
|
||||
],
|
||||
"extract": {
|
||||
"varFoo1": "body.args.foo1"
|
||||
|
||||
@@ -24,7 +24,7 @@ teststeps:
|
||||
method: POST
|
||||
url: /post
|
||||
headers:
|
||||
User-Agent: funplugin/${GetVersion()}
|
||||
User-Agent: funplugin/${get_version()}
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo3"
|
||||
validate:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"variables": {
|
||||
"foo1": "${ENV(USERNAME)}",
|
||||
"foo2": "bar21",
|
||||
"sum_v": "${SumTwoInt(1, 2)}"
|
||||
"sum_v": "${sum_two_int(1, 2)}"
|
||||
},
|
||||
"request": {
|
||||
"method": "GET",
|
||||
@@ -30,7 +30,7 @@
|
||||
"sum_v": "$sum_v"
|
||||
},
|
||||
"headers": {
|
||||
"User-Agent": "funplugin/${GetVersion()}"
|
||||
"User-Agent": "funplugin/${get_version()}"
|
||||
}
|
||||
},
|
||||
"extract": {
|
||||
@@ -73,7 +73,7 @@
|
||||
"method": "POST",
|
||||
"url": "/post",
|
||||
"headers": {
|
||||
"User-Agent": "funplugin/${GetVersion()}",
|
||||
"User-Agent": "funplugin/${get_version()}",
|
||||
"Content-Type": "text/plain"
|
||||
},
|
||||
"body": "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||
@@ -102,7 +102,7 @@
|
||||
"method": "POST",
|
||||
"url": "/post",
|
||||
"headers": {
|
||||
"User-Agent": "funplugin/${GetVersion()}",
|
||||
"User-Agent": "funplugin/${get_version()}",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
"body": "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||
|
||||
@@ -14,7 +14,7 @@ teststeps:
|
||||
variables:
|
||||
foo1: ${ENV(USERNAME)}
|
||||
foo2: bar21
|
||||
sum_v: "${SumTwoInt(1, 2)}"
|
||||
sum_v: "${sum_two_int(1, 2)}"
|
||||
request:
|
||||
method: GET
|
||||
url: $base_url/get
|
||||
@@ -23,7 +23,7 @@ teststeps:
|
||||
foo2: $foo2
|
||||
sum_v: $sum_v
|
||||
headers:
|
||||
User-Agent: funplugin/${GetVersion()}
|
||||
User-Agent: funplugin/${get_version()}
|
||||
extract:
|
||||
foo3: "body.args.foo2"
|
||||
validate:
|
||||
@@ -40,7 +40,7 @@ teststeps:
|
||||
method: POST
|
||||
url: $base_url/post
|
||||
headers:
|
||||
User-Agent: funplugin/${GetVersion()}
|
||||
User-Agent: funplugin/${get_version()}
|
||||
Content-Type: "text/plain"
|
||||
body: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||
validate:
|
||||
@@ -54,7 +54,7 @@ teststeps:
|
||||
method: POST
|
||||
url: $base_url/post
|
||||
headers:
|
||||
User-Agent: funplugin/${GetVersion()}
|
||||
User-Agent: funplugin/${get_version()}
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||
validate:
|
||||
|
||||
Reference in New Issue
Block a user