Tests if the right protocol is selected given multiple
(message, transport)
| 118 | |
| 119 | |
| 120 | def test_handshake_protocol_agreement(message, transport): |
| 121 | '''Tests if the right protocol is selected given multiple''' |
| 122 | best_proto = 'worse_proto' |
| 123 | wanted_protos = ['best', 'chat', 'worse_proto'] |
| 124 | server_protos = 'worse_proto,chat' |
| 125 | |
| 126 | message.headers.extend(gen_ws_headers(server_protos)[0]) |
| 127 | _, resp_headers, _, _, protocol = websocket.do_handshake( |
| 128 | message.method, message.headers, transport, |
| 129 | protocols=wanted_protos) |
| 130 | |
| 131 | assert protocol == best_proto |
| 132 | |
| 133 | |
| 134 | def test_handshake_protocol_unsupported(log, message, transport): |
nothing calls this directly
no test coverage detected