Client offers several extensions and the server enables them.
(self)
| 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.""" |
nothing calls this directly
no test coverage detected