From e92a6ddf42df9caac0f826d9489f171743bb2be1 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 8 Jun 2025 22:15:27 +0900 Subject: [PATCH] Fix conflicting test case name ... and fix the wrong format of Sec-WebSocket-Protocol header in test case. --- tests/test_websocket.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_websocket.py b/tests/test_websocket.py index 8ee44f9..42d658d 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -81,7 +81,7 @@ class AcceptTestCase(unittest.TestCase): ws.accept(sock, {'upgrade': 'websocket', 'Sec-WebSocket-Version': '13', 'Sec-WebSocket-Key': 'DKURYVK9cRFul1vOZVA56Q==', - 'Sec-WebSocket-Protocol': 'foobar gazonk'}) + 'Sec-WebSocket-Protocol': 'foobar,gazonk'}) self.assertEqual(sock.data[:13], b'HTTP/1.1 101 ') self.assertTrue(b'\r\nSec-WebSocket-Protocol: gazonk\r\n' in sock.data) @@ -101,9 +101,9 @@ class AcceptTestCase(unittest.TestCase): sock, {'upgrade': 'websocket', 'Sec-WebSocket-Version': '13', 'Sec-WebSocket-Key': 'DKURYVK9cRFul1vOZVA56Q==', - 'Sec-WebSocket-Protocol': 'foobar gazonk'}) + 'Sec-WebSocket-Protocol': 'foobar,gazonk'}) - def test_protocol(self): + def test_unsupported_protocol(self): class ProtoSocket(websocket.WebSocket): def select_subprotocol(self, protocol): return 'oddball' @@ -114,7 +114,7 @@ class AcceptTestCase(unittest.TestCase): sock, {'upgrade': 'websocket', 'Sec-WebSocket-Version': '13', 'Sec-WebSocket-Key': 'DKURYVK9cRFul1vOZVA56Q==', - 'Sec-WebSocket-Protocol': 'foobar gazonk'}) + 'Sec-WebSocket-Protocol': 'foobar,gazonk'}) class PingPongTest(unittest.TestCase): def setUp(self):