- Timestamp:
- Dec 4, 2019, 9:36:10 AM (15 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 2e736df
- Parents:
- 851173b
- git-author:
- Fiona Klute <fiona.klute@…> (12/04/19 09:19:25)
- git-committer:
- Fiona Klute <fiona.klute@…> (12/04/19 09:36:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
r851173b rce85a5f 112 112 f'method={self.method!r}, headers={self.headers!r}, ' 113 113 f'expect={self.expect!r})') 114 115 def run(self, conn): 116 try: 117 conn.request(self.method, self.path, headers=self.headers) 118 resp = conn.getresponse() 119 except ConnectionResetError as err: 120 if self.expects_conn_reset(): 121 print('connection reset as expected.') 122 return 123 else: 124 raise err 125 body = resp.read().decode() 126 print(format_response(resp, body)) 127 self.check_response(resp, body) 114 128 115 129 def _check_body(self, body): … … 376 390 for act in test_actions: 377 391 if type(act) is TestRequest: 378 try: 379 conn.request(act.method, act.path, headers=act.headers) 380 resp = conn.getresponse() 381 except ConnectionResetError as err: 382 if act.expects_conn_reset(): 383 print('connection reset as expected.') 384 break 385 else: 386 raise err 387 body = resp.read().decode() 388 print(format_response(resp, body)) 389 act.check_response(resp, body) 392 act.run(conn) 390 393 elif type(act) is TestRaw10: 391 394 act.run(command, conn.timeout)
Note: See TracChangeset
for help on using the changeset viewer.