Test recv_line functionality
(self)
| 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""" |
nothing calls this directly
no test coverage detected