Tests if one protocol is returned by do_handshake
(message, transport)
| 102 | |
| 103 | |
| 104 | def test_handshake_protocol(message, transport): |
| 105 | '''Tests if one protocol is returned by do_handshake''' |
| 106 | proto = 'chat' |
| 107 | |
| 108 | message.headers.extend(gen_ws_headers(proto)[0]) |
| 109 | _, resp_headers, _, _, protocol = websocket.do_handshake( |
| 110 | message.method, message.headers, transport, |
| 111 | protocols=[proto]) |
| 112 | |
| 113 | assert protocol == proto |
| 114 | |
| 115 | # also test if we reply with the protocol |
| 116 | resp_headers = dict(resp_headers) |
| 117 | assert resp_headers['SEC-WEBSOCKET-PROTOCOL'] == proto |
| 118 | |
| 119 | |
| 120 | def test_handshake_protocol_agreement(message, transport): |
nothing calls this directly
no test coverage detected