@@ -24,6 +24,10 @@ def mock_queue(self, client):
2424 client .queue .put = mock .AsyncMock ()
2525 client .queue .join = mock .AsyncMock ()
2626
27+ @staticmethod
28+ def mock_ws_timeout (ws_close ):
29+ return ws_close
30+
2731 async def test_is_asyncio_based (self ):
2832 c = async_client .AsyncClient ()
2933 assert c .is_asyncio_based ()
@@ -500,6 +504,8 @@ async def test_polling_connection_not_upgraded(self):
500504 assert c in base_client .connected_clients
501505
502506 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
507+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
508+ new = mock_ws_timeout )
503509 async def test_websocket_connection_failed (self , _time ):
504510 c = async_client .AsyncClient ()
505511 c .http = mock .MagicMock (closed = False )
@@ -541,6 +547,8 @@ async def test_websocket_connection_extra(self, _time):
541547 )
542548
543549 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
550+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
551+ new = mock_ws_timeout )
544552 async def test_websocket_upgrade_failed (self , _time ):
545553 c = async_client .AsyncClient ()
546554 c .http = mock .MagicMock (closed = False )
@@ -568,6 +576,8 @@ async def test_websocket_connection_no_open_packet(self):
568576 await c .connect ('http://foo' , transports = ['websocket' ])
569577
570578 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
579+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
580+ new = mock_ws_timeout )
571581 async def test_websocket_connection_successful (self , _time ):
572582 c = async_client .AsyncClient ()
573583 c .http = mock .MagicMock (closed = False )
@@ -649,6 +659,8 @@ async def test_websocket_https_noverify_connection_successful(self, _time):
649659 assert kwargs ['ssl' ].verify_mode == ssl .CERT_NONE
650660
651661 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
662+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
663+ new = mock_ws_timeout )
652664 async def test_websocket_connection_with_cookies (self , _time ):
653665 c = async_client .AsyncClient ()
654666 c .http = mock .MagicMock (closed = False )
@@ -682,6 +694,8 @@ async def test_websocket_connection_with_cookies(self, _time):
682694 )
683695
684696 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
697+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
698+ new = mock_ws_timeout )
685699 async def test_websocket_connection_with_cookie_header (self , _time ):
686700 c = async_client .AsyncClient ()
687701 c .http = mock .MagicMock (closed = False )
@@ -718,6 +732,8 @@ async def test_websocket_connection_with_cookie_header(self, _time):
718732 )
719733
720734 @mock .patch ('engineio.client.time.time' , return_value = 123.456 )
735+ @mock .patch ('engineio.async_client.aiohttp.ClientWSTimeout' ,
736+ new = mock_ws_timeout )
721737 async def test_websocket_connection_with_cookies_and_headers (self , _time ):
722738 c = async_client .AsyncClient ()
723739 c .http = mock .MagicMock (closed = False )
0 commit comments