mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix #278: len_eq for content
This commit is contained in:
@@ -89,5 +89,15 @@
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
|
||||
- test:
|
||||
name: validate content length
|
||||
request:
|
||||
url: /spec.json
|
||||
method: GET
|
||||
validate:
|
||||
- len_eq: ["content", 9]
|
||||
- len_eq: ["json", 9]
|
||||
- len_eq: ["text", 9]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -367,6 +367,12 @@ class TestHttpRunner(ApiServerUnittest):
|
||||
self.assertIsInstance(parsed_testcases, list)
|
||||
self.assertEqual(parsed_testcases[0]["config"]["name"], '12311')
|
||||
|
||||
def test_validate_response_content(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/httpbin/basic.yml')
|
||||
runner = HttpRunner().run(testcase_file_path)
|
||||
self.assertTrue(runner.summary["success"])
|
||||
|
||||
|
||||
class TestLocustRunner(ApiServerUnittest):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user