Client offers a subprotocol and the server enables it.
(self)
| 590 | self.assertEqual(request.headers["Sec-WebSocket-Protocol"], "chat") |
| 591 | |
| 592 | def test_enable_subprotocol(self): |
| 593 | """Client offers a subprotocol and the server enables it.""" |
| 594 | client = ClientProtocol(URI, subprotocols=["chat"]) |
| 595 | with alter_and_receive_response(client) as response: |
| 596 | response.headers["Sec-WebSocket-Protocol"] = "chat" |
| 597 | |
| 598 | self.assertHandshakeSuccess(client) |
| 599 | self.assertEqual(client.subprotocol, "chat") |
| 600 | |
| 601 | def test_no_subprotocol_accepted(self): |
| 602 | """Client offers a subprotocol, but the server doesn't enable it.""" |
nothing calls this directly
no test coverage detected