(message, transport)
| 87 | |
| 88 | |
| 89 | def test_handshake(message, transport): |
| 90 | hdrs, sec_key = gen_ws_headers() |
| 91 | |
| 92 | message.headers.extend(hdrs) |
| 93 | status, headers, parser, writer, protocol = websocket.do_handshake( |
| 94 | message.method, message.headers, transport) |
| 95 | assert status == 101 |
| 96 | assert protocol is None |
| 97 | |
| 98 | key = base64.b64encode( |
| 99 | hashlib.sha1(sec_key.encode() + websocket.WS_KEY).digest()) |
| 100 | headers = dict(headers) |
| 101 | assert headers['SEC-WEBSOCKET-ACCEPT'] == key.decode() |
| 102 | |
| 103 | |
| 104 | def test_handshake_protocol(message, transport): |
nothing calls this directly
no test coverage detected