change method name

This commit is contained in:
httprunner
2017-06-28 23:25:08 +08:00
parent f5705e37f8
commit 895553e158
3 changed files with 25 additions and 22 deletions

View File

@@ -9,25 +9,25 @@ class TestResponse(ApiServerUnittest):
url = "http://127.0.0.1:5000/api/users"
resp = requests.get(url)
resp_obj = response.ResponseObject(resp)
parse_result = resp_obj.parse_response_object()
self.assertIn('status_code', parse_result)
self.assertIn('headers', parse_result)
self.assertIn('body', parse_result)
self.assertIn('Content-Type', parse_result['headers'])
self.assertIn('Content-Length', parse_result['headers'])
self.assertIn('success', parse_result['body'])
parsed_dict = resp_obj.parsed_dict()
self.assertIn('status_code', parsed_dict)
self.assertIn('headers', parsed_dict)
self.assertIn('body', parsed_dict)
self.assertIn('Content-Type', parsed_dict['headers'])
self.assertIn('Content-Length', parsed_dict['headers'])
self.assertIn('success', parsed_dict['body'])
def test_parse_response_object_text(self):
url = "http://127.0.0.1:5000/"
resp = requests.get(url)
resp_obj = response.ResponseObject(resp)
parse_result = resp_obj.parse_response_object()
self.assertIn('status_code', parse_result)
self.assertIn('headers', parse_result)
self.assertIn('body', parse_result)
self.assertIn('Content-Type', parse_result['headers'])
self.assertIn('Content-Length', parse_result['headers'])
self.assertTrue(str, type(parse_result['body']))
parsed_dict = resp_obj.parsed_dict()
self.assertIn('status_code', parsed_dict)
self.assertIn('headers', parsed_dict)
self.assertIn('body', parsed_dict)
self.assertIn('Content-Type', parsed_dict['headers'])
self.assertIn('Content-Length', parsed_dict['headers'])
self.assertTrue(str, type(parsed_dict['body']))
def test_diff_response_status_code_equal(self):
status_code = random.randint(200, 511)