Skip to content

Commit 9fc0926

Browse files
committed
pep8 fixes
1 parent e6c88ad commit 9fc0926

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_websocket.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,17 @@ def test_handshake_protocol_agreement(self):
470470
protocols=wanted_protos)
471471

472472
self.assertEqual(protocol, best_proto)
473+
474+
def test_handshake_protocol_unsupported(self):
475+
proto = 'chat'
476+
477+
self.headers.extend(self.gen_ws_headers('test')[0])
478+
_, resp_headers, _, _, protocol = websocket.do_handshake(
479+
self.message.method, self.message.headers, self.transport,
480+
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)