From f5f2aa79db78d4c39e5b47226dbc8d3ec50fa9f8 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 4 Jun 2023 16:38:10 +0100 Subject: [PATCH] Test robustness for pypy build #nolog --- tests/test_simple_websocket_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_simple_websocket_client.py b/tests/test_simple_websocket_client.py index 1b909e1..7075425 100644 --- a/tests/test_simple_websocket_client.py +++ b/tests/test_simple_websocket_client.py @@ -66,6 +66,11 @@ def test_make_client_headers(self, mock_wsconn, mock_socket): client.sock.send.assert_called_with( b"Request(host='example.com', target='/ws?a=1', extensions=[], " b"extra_headers=[('Foo', 'Bar')], subprotocols=[])") + + @mock.patch('simple_websocket.ws.socket.socket') + @mock.patch('simple_websocket.ws.WSConnection') + def test_make_client_headers2(self, mock_wsconn, mock_socket): + mock_socket.return_value.recv.return_value = b'x' client = self.get_client(mock_wsconn, 'ws://example.com/ws?a=1', headers=[('Foo', 'Bar'), ('Foo', 'Baz')]) client.sock.send.assert_called_with(