Skip to content

Commit aae6ffd

Browse files
committed
more tests for websocket handshake
1 parent 9fc0926 commit aae6ffd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/test_websocket.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,10 @@ def test_handshake_protocol_agreement(self):
473473

474474
def test_handshake_protocol_unsupported(self):
475475
proto = 'chat'
476-
477476
self.headers.extend(self.gen_ws_headers('test')[0])
478-
_, resp_headers, _, _, protocol = websocket.do_handshake(
477+
478+
self.assertRaises(
479+
errors.HttpBadRequest,
480+
websocket.do_handshake,
479481
self.message.method, self.message.headers, self.transport,
480482
protocols=[proto])
481-
482-
self.assertEqual(protocol, proto)
483-
484-
# also test if we reply with the protocol
485-
resp_headers = dict(resp_headers)
486-
self.assertEqual(resp_headers['SEC-WEBSOCKET-PROTOCOL'], proto)

0 commit comments

Comments
 (0)