Handshake fails when the Sec-WebSocket-Accept header is invalid.
(self)
| 423 | ) |
| 424 | |
| 425 | def test_invalid_accept(self): |
| 426 | """Handshake fails when the Sec-WebSocket-Accept header is invalid.""" |
| 427 | client = ClientProtocol(URI) |
| 428 | with alter_and_receive_response(client) as response: |
| 429 | del response.headers["Sec-WebSocket-Accept"] |
| 430 | response.headers["Sec-WebSocket-Accept"] = ACCEPT |
| 431 | |
| 432 | self.assertHandshakeError( |
| 433 | client, |
| 434 | InvalidHeader, |
| 435 | f"invalid Sec-WebSocket-Accept header: {ACCEPT}", |
| 436 | ) |
| 437 | |
| 438 | def test_no_extensions(self): |
| 439 | """Handshake succeeds without extensions.""" |
nothing calls this directly
no test coverage detected