MCPcopy
hub / github.com/httprunner/httprunner / TestCaseValidate

Class TestCaseValidate

examples/httpbin/validate_test.py:6–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6class TestCaseValidate(HttpRunner):
7
8 config = Config("basic test with httpbin").base_url("${get_httpbin_server()}")
9
10 teststeps = [
11 Step(
12 RunRequest("validate response with json path")
13 .get("/get")
14 .with_params(**{"a": 1, "b": 2})
15 .validate()
16 .assert_equal("status_code", 200)
17 .assert_equal("body.args.a", "1")
18 .assert_equal("body.args.b", "2")
19 ),
20 Step(
21 RunRequest("validate response with python script")
22 .get("/get")
23 .with_params(**{"a": 1, "b": 2})
24 .validate()
25 .assert_equal("status_code", 200)
26 ),
27 ]
28
29
30if __name__ == "__main__":

Callers 1

validate_test.pyFile · 0.85

Calls 8

ConfigClass · 0.90
StepClass · 0.90
RunRequestClass · 0.90
base_urlMethod · 0.80
assert_equalMethod · 0.80
validateMethod · 0.45
with_paramsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected