(self)
| 324 | self.assertEqual(int(res.getheader('Content-Length')), len(data)) |
| 325 | |
| 326 | def test_send_error(self): |
| 327 | allow_transfer_encoding_codes = (HTTPStatus.NOT_MODIFIED, |
| 328 | HTTPStatus.RESET_CONTENT) |
| 329 | for code in (HTTPStatus.NO_CONTENT, HTTPStatus.NOT_MODIFIED, |
| 330 | HTTPStatus.PROCESSING, HTTPStatus.RESET_CONTENT, |
| 331 | HTTPStatus.SWITCHING_PROTOCOLS): |
| 332 | self.con.request('SEND_ERROR', '/{}'.format(code)) |
| 333 | res = self.con.getresponse() |
| 334 | self.assertEqual(code, res.status) |
| 335 | self.assertEqual(None, res.getheader('Content-Length')) |
| 336 | self.assertEqual(None, res.getheader('Content-Type')) |
| 337 | if code not in allow_transfer_encoding_codes: |
| 338 | self.assertEqual(None, res.getheader('Transfer-Encoding')) |
| 339 | |
| 340 | data = res.read() |
| 341 | self.assertEqual(b'', data) |
| 342 | |
| 343 | def test_head_via_send_error(self): |
| 344 | allow_transfer_encoding_codes = (HTTPStatus.NOT_MODIFIED, |
nothing calls this directly
no test coverage detected