mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: unittests
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
{
|
||||
"config": {
|
||||
"name": "postman collection demo"
|
||||
},
|
||||
"teststeps": [
|
||||
{
|
||||
"name": "folder1 - folder2 - Get with params",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https://postman-echo.com/get",
|
||||
"params": {
|
||||
"k1": "v1",
|
||||
"k2": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folder3 - Post form-data",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https://postman-echo.com/post",
|
||||
"upload": {
|
||||
"intro_key": "intro.txt",
|
||||
"k1": "v1",
|
||||
"k2": "v2",
|
||||
"logo_key": "logo.jpeg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folder3 - Post x-www-form-urlencoded",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https://postman-echo.com/post",
|
||||
"headers": {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
"body": {
|
||||
"k1": "v1",
|
||||
"k2": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folder3 - Post raw json",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https://postman-echo.com/post",
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"body": {
|
||||
"k1": "v1",
|
||||
"k2": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folder3 - Post raw text",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https://postman-echo.com/post",
|
||||
"headers": {
|
||||
"Content-Type": "text/plain"
|
||||
},
|
||||
"body": "have a nice day"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Get request headers",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https://postman-echo.com/headers",
|
||||
"headers": {
|
||||
"Connection": "close",
|
||||
"User-Agent": "HttpRunner"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
# NOTE: Generated By HttpRunner v4.1.4
|
||||
# FROM: postman/postman_collection_test.json
|
||||
from httprunner import HttpRunner, Config, Step, RunRequest
|
||||
|
||||
|
||||
class TestCasePostmanCollectionTest(HttpRunner):
|
||||
|
||||
config = Config("postman collection demo")
|
||||
|
||||
teststeps = [
|
||||
Step(
|
||||
RunRequest("folder1 - folder2 - Get with params")
|
||||
.get("https://postman-echo.com/get")
|
||||
.with_params(**{"k1": "v1", "k2": "v2"})
|
||||
),
|
||||
Step(
|
||||
RunRequest("folder3 - Post form-data")
|
||||
.post("https://postman-echo.com/post")
|
||||
.upload(
|
||||
**{
|
||||
"intro_key": "intro.txt",
|
||||
"k1": "v1",
|
||||
"k2": "v2",
|
||||
"logo_key": "logo.jpeg",
|
||||
}
|
||||
)
|
||||
),
|
||||
Step(
|
||||
RunRequest("folder3 - Post x-www-form-urlencoded")
|
||||
.post("https://postman-echo.com/post")
|
||||
.with_headers(**{"Content-Type": "application/x-www-form-urlencoded"})
|
||||
.with_data({"k1": "v1", "k2": "v2"})
|
||||
),
|
||||
Step(
|
||||
RunRequest("folder3 - Post raw json")
|
||||
.post("https://postman-echo.com/post")
|
||||
.with_headers(**{"Content-Type": "application/json"})
|
||||
.with_json({"k1": "v1", "k2": "v2"})
|
||||
),
|
||||
Step(
|
||||
RunRequest("folder3 - Post raw text")
|
||||
.post("https://postman-echo.com/post")
|
||||
.with_headers(**{"Content-Type": "text/plain"})
|
||||
.with_data("have a nice day")
|
||||
),
|
||||
Step(
|
||||
RunRequest("Get request headers")
|
||||
.get("https://postman-echo.com/headers")
|
||||
.with_headers(**{"Connection": "close", "User-Agent": "HttpRunner"})
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
TestCasePostmanCollectionTest().test_start()
|
||||
Reference in New Issue
Block a user