88from airos .discovery import (
99 DISCOVERY_PORT ,
1010 AirOSDiscoveryProtocol ,
11- async_discover_devices ,
11+ airos_discover_devices ,
1212)
1313from airos .exceptions import AirOSDiscoveryError , AirOSEndpointError , AirOSListenerError
1414import pytest
@@ -247,7 +247,7 @@ async def _simulate_discovery():
247247 mock_protocol_factory (MagicMock ()).callback (parsed_data )
248248
249249 with patch ("asyncio.sleep" , new = AsyncMock ()):
250- discovery_task = asyncio .create_task (async_discover_devices (timeout = 1 ))
250+ discovery_task = asyncio .create_task (airos_discover_devices (timeout = 1 ))
251251
252252 await _simulate_discovery ()
253253
@@ -264,7 +264,7 @@ async def test_async_discover_devices_no_devices(mock_datagram_endpoint):
264264 mock_transport , _ = mock_datagram_endpoint
265265
266266 with patch ("asyncio.sleep" , new = AsyncMock ()):
267- result = await async_discover_devices (timeout = 1 )
267+ result = await airos_discover_devices (timeout = 1 )
268268
269269 assert result == {}
270270 mock_transport .close .assert_called_once ()
@@ -284,7 +284,7 @@ async def test_async_discover_devices_oserror(mock_datagram_endpoint):
284284 side_effect = OSError (98 , "Address in use" )
285285 )
286286
287- await async_discover_devices (timeout = 1 )
287+ await airos_discover_devices (timeout = 1 )
288288
289289 assert "address_in_use" in str (excinfo .value )
290290 mock_transport .close .assert_not_called ()
@@ -300,7 +300,7 @@ async def test_async_discover_devices_cancelled(mock_datagram_endpoint):
300300 patch ("asyncio.sleep" , new = AsyncMock (side_effect = asyncio .CancelledError )),
301301 pytest .raises (AirOSListenerError ) as excinfo ,
302302 ):
303- await async_discover_devices (timeout = 1 )
303+ await airos_discover_devices (timeout = 1 )
304304
305305 assert "cannot_connect" in str (excinfo .value )
306306 mock_transport .close .assert_called_once ()
@@ -373,7 +373,7 @@ async def test_async_discover_devices_generic_oserror(mock_datagram_endpoint):
373373 mock_loop .create_datagram_endpoint = AsyncMock (
374374 side_effect = OSError (13 , "Permission denied" )
375375 )
376- await async_discover_devices (timeout = 1 )
376+ await airos_discover_devices (timeout = 1 )
377377
378378 assert "cannot_connect" in str (excinfo .value )
379379 mock_transport .close .assert_not_called ()
0 commit comments