accept() handles unexpected errors and returns an error response.
(self, process_request)
| 319 | side_effect=Exception("BOOM"), |
| 320 | ) |
| 321 | def test_unexpected_error(self, process_request): |
| 322 | """accept() handles unexpected errors and returns an error response.""" |
| 323 | server = ServerProtocol() |
| 324 | request = make_request() |
| 325 | response = server.accept(request) |
| 326 | |
| 327 | self.assertEqual(response.status_code, 500) |
| 328 | self.assertIsInstance(server.handshake_exc, Exception) |
| 329 | self.assertEqual(str(server.handshake_exc), "BOOM") |
| 330 | |
| 331 | |
| 332 | class HandshakeTests(unittest.TestCase): |
nothing calls this directly
no test coverage detected