MCPcopy Create free account
hub / github.com/websocket-client/websocket-client / test_recv_line

Method test_recv_line

websocket/tests/test_socket.py:158–169  ·  view source on GitHub ↗

Test recv_line functionality

(self)

Source from the content-addressed store, hash-verified

156 recv(mock_sock, 100)
157
158 def test_recv_line(self):
159 """Test recv_line functionality"""
160 mock_sock = Mock()
161
162 # Mock recv to return one character at a time
163 recv_calls = [b"H", b"e", b"l", b"l", b"o", b"\n"]
164
165 with patch("websocket._socket.recv", side_effect=recv_calls) as mock_recv:
166 result = recv_line(mock_sock)
167
168 self.assertEqual(result, b"Hello\n")
169 self.assertEqual(mock_recv.call_count, 6)
170
171 def test_send_normal(self):
172 """Test normal send operation"""

Callers

nothing calls this directly

Calls 1

recv_lineFunction · 0.90

Tested by

no test coverage detected