@ -163,6 +163,8 @@ class AsyncSimpleClient:
return await self.client.call(event, data,
namespace=self.namespace,
timeout=timeout)
except TimeoutError:
raise
except SocketIOError:
pass
@ -155,6 +155,8 @@ class SimpleClient:
try:
return self.client.call(event, data, namespace=self.namespace,
@ -142,6 +142,17 @@ class TestAsyncAsyncSimpleClient:
client.client.call.assert_awaited_with('foo', 'bar', namespace='/',
timeout=60)
async def test_call_timeout(self):
client = AsyncSimpleClient()
client.connected_event.set()
client.connected = True
client.client = mock.MagicMock()
client.client.call = mock.AsyncMock()
client.client.call.side_effect = TimeoutError()
with pytest.raises(TimeoutError):
await client.call('foo', 'bar')
async def test_receive_with_input_buffer(self):
client.input_buffer = ['foo', 'bar']
@ -130,6 +130,16 @@ class TestSimpleClient:
client.client.call.assert_called_with('foo', 'bar', namespace='/',
def test_call_timeout(self):
client = SimpleClient()
client.call('foo', 'bar')
def test_receive_with_input_buffer(self):