mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-24 09:50:00 +08:00
test: add example tests on httpbin
This commit is contained in:
47
examples/httpbin/load_image_test.py
Normal file
47
examples/httpbin/load_image_test.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||
from httprunner import HttpRunner, TConfig, TStep
|
||||
|
||||
|
||||
class TestCaseLoadImage(HttpRunner):
|
||||
config = TConfig(
|
||||
**{
|
||||
"name": "load images",
|
||||
"base_url": "${get_httpbin_server()}",
|
||||
"path": "examples/httpbin/load_image_test.py",
|
||||
}
|
||||
)
|
||||
|
||||
teststeps = [
|
||||
TStep(
|
||||
**{
|
||||
"name": "get png image",
|
||||
"request": {"url": "/image/png", "method": "GET"},
|
||||
"validate": [{"eq": ["status_code", 200]}],
|
||||
}
|
||||
),
|
||||
TStep(
|
||||
**{
|
||||
"name": "get jpeg image",
|
||||
"request": {"url": "/image/jpeg", "method": "GET"},
|
||||
"validate": [{"eq": ["status_code", 200]}],
|
||||
}
|
||||
),
|
||||
TStep(
|
||||
**{
|
||||
"name": "get webp image",
|
||||
"request": {"url": "/image/webp", "method": "GET"},
|
||||
"validate": [{"eq": ["status_code", 200]}],
|
||||
}
|
||||
),
|
||||
TStep(
|
||||
**{
|
||||
"name": "get svg image",
|
||||
"request": {"url": "/image/svg", "method": "GET"},
|
||||
"validate": [{"eq": ["status_code", 200]}],
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
TestCaseLoadImage().test_start()
|
||||
Reference in New Issue
Block a user