Lines Matching refs:HTTPStatus
9 from http import server, HTTPStatus
90 self.send_response(HTTPStatus.NO_CONTENT)
96 self.send_response(HTTPStatus.NO_CONTENT)
105 self.send_error(HTTPStatus.NOT_FOUND)
139 self.assertEqual(res.status, HTTPStatus.NOT_IMPLEMENTED)
146 self.assertEqual(res.status, HTTPStatus.NOT_IMPLEMENTED)
153 self.assertEqual(res.status, HTTPStatus.BAD_REQUEST)
160 self.assertEqual(res.status, HTTPStatus.BAD_REQUEST)
167 self.assertEqual(res.status, HTTPStatus.NOT_IMPLEMENTED)
175 self.assertEqual(res.status, HTTPStatus.BAD_REQUEST)
183 self.assertEqual(res.status, HTTPStatus.HTTP_VERSION_NOT_SUPPORTED)
190 self.assertEqual(res.status, HTTPStatus.BAD_REQUEST)
197 self.assertEqual(res.status, HTTPStatus.NOT_IMPLEMENTED)
205 self.assertEqual(res.status, HTTPStatus.NOT_IMPLEMENTED)
210 self.assertEqual(res.status, HTTPStatus.NO_CONTENT)
247 self.assertEqual(res.status, HTTPStatus.NOT_FOUND)
253 allow_transfer_encoding_codes = (HTTPStatus.NOT_MODIFIED,
254 HTTPStatus.RESET_CONTENT)
255 for code in (HTTPStatus.NO_CONTENT, HTTPStatus.NOT_MODIFIED,
256 HTTPStatus.PROCESSING, HTTPStatus.RESET_CONTENT,
257 HTTPStatus.SWITCHING_PROTOCOLS):
270 allow_transfer_encoding_codes = (HTTPStatus.NOT_MODIFIED,
271 HTTPStatus.RESET_CONTENT)
272 for code in (HTTPStatus.OK, HTTPStatus.NO_CONTENT,
273 HTTPStatus.NOT_MODIFIED, HTTPStatus.RESET_CONTENT,
274 HTTPStatus.SWITCHING_PROTOCOLS):
278 if code == HTTPStatus.OK:
297 self.send_response(HTTPStatus.OK)
301 self.send_error(HTTPStatus.NOT_FOUND, 'File not found')
406 body = self.check_status_and_reason(response, HTTPStatus.OK)
413 self.check_status_and_reason(response, HTTPStatus.OK,
419 self.check_status_and_reason(response, HTTPStatus.OK, data=self.data)
422 self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
424 self.check_status_and_reason(response, HTTPStatus.OK)
426 self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
428 self.check_status_and_reason(response, HTTPStatus.OK)
430 self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
434 self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
436 self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
442 self.check_status_and_reason(response, HTTPStatus.OK, data)
450 self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
457 self.check_status_and_reason(response, HTTPStatus.OK)
471 self.check_status_and_reason(response, HTTPStatus.NOT_MODIFIED)
479 self.check_status_and_reason(response, HTTPStatus.NOT_MODIFIED)
490 self.check_status_and_reason(response, HTTPStatus.OK)
499 self.check_status_and_reason(response, HTTPStatus.OK)
503 self.check_status_and_reason(response, HTTPStatus.NOT_IMPLEMENTED)
506 self.check_status_and_reason(response, HTTPStatus.NOT_IMPLEMENTED)
508 self.check_status_and_reason(response, HTTPStatus.NOT_IMPLEMENTED)
515 self.check_status_and_reason(response, HTTPStatus.OK, data=self.data)
521 self.check_status_and_reason(response, HTTPStatus.OK, data=self.data)
523 self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
525 self.check_status_and_reason(response, HTTPStatus.OK)
527 self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
529 self.check_status_and_reason(response, HTTPStatus.OK)
531 self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
547 body = self.check_status_and_reason(response, HTTPStatus.OK)
721 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK))
725 self.assertEqual(res.status, HTTPStatus.NOT_FOUND)
738 self.assertEqual(res.status, HTTPStatus.NOT_FOUND)
745 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
752 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
760 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
767 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
773 (b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
779 (b'a=b?c=d' + self.linesep, 'text/html', HTTPStatus.OK),
786 'text/html', HTTPStatus.OK),
801 self.send_response(HTTPStatus.OK)
811 self.send_error(HTTPStatus.EXPECTATION_FAILED)