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

Method test_multiple_extensions

tests/test_client.py:532–546  ·  view source on GitHub ↗

Client offers several extensions and the server enables them.

(self)

Source from the content-addressed store, hash-verified

530 self.assertEqual(client.extensions, [OpExtension("that")])
531
532 def test_multiple_extensions(self):
533 """Client offers several extensions and the server enables them."""
534 client = ClientProtocol(
535 URI,
536 extensions=[
537 ClientOpExtensionFactory(),
538 ClientRsv2ExtensionFactory(),
539 ],
540 )
541 with alter_and_receive_response(client) as response:
542 response.headers["Sec-WebSocket-Extensions"] = "x-op; op"
543 response.headers["Sec-WebSocket-Extensions"] = "x-rsv2"
544
545 self.assertHandshakeSuccess(client)
546 self.assertEqual(client.extensions, [OpExtension(), Rsv2Extension()])
547
548 def test_multiple_extensions_order(self):
549 """Client respects the order of extensions chosen by the server."""

Callers

nothing calls this directly

Calls 7

ClientProtocolClass · 0.85
OpExtensionClass · 0.85
Rsv2ExtensionClass · 0.85

Tested by

no test coverage detected