fix #278: len_eq for content

This commit is contained in:
debugtalk
2018-08-23 19:24:11 +08:00
parent 73fba1f2b2
commit 45374cd71d
2 changed files with 16 additions and 0 deletions

View File

@@ -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]

View File

@@ -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):