MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_enable_extension

Method test_enable_extension

tests/test_client.py:454–461  ·  view source on GitHub ↗

Client offers an extension and the server enables it.

(self)

Source from the content-addressed store, hash-verified

452 self.assertEqual(request.headers["Sec-WebSocket-Extensions"], "x-rsv2")
453
454 def test_enable_extension(self):
455 """Client offers an extension and the server enables it."""
456 client = ClientProtocol(URI, extensions=[ClientRsv2ExtensionFactory()])
457 with alter_and_receive_response(client) as response:
458 response.headers["Sec-WebSocket-Extensions"] = "x-rsv2"
459
460 self.assertHandshakeSuccess(client)
461 self.assertEqual(client.extensions, [Rsv2Extension()])
462
463 def test_extension_not_enabled(self):
464 """Client offers an extension, but the server doesn't enable it."""

Callers

nothing calls this directly

Calls 5

ClientProtocolClass · 0.85
Rsv2ExtensionClass · 0.85

Tested by

no test coverage detected