1313import aiohttp
1414
1515
16- async def _read_fixture (fixture : str = "ap -ptp" ):
16+ async def _read_fixture (fixture : str = "airos_loco5ac_ap -ptp" ):
1717 """Read fixture file per device type."""
1818 fixture_dir = os .path .join (os .path .dirname (__file__ ), ".." , "fixtures" )
1919 path = os .path .join (fixture_dir , f"{ fixture } .json" )
@@ -26,9 +26,12 @@ async def _read_fixture(fixture: str = "ap-ptp"):
2626 pytest .fail (f"Invalid JSON in fixture file { path } : { e } " )
2727
2828
29- @pytest .mark .parametrize ("mode" , ["ap-ptp" , "sta-ptp" ])
29+ @pytest .mark .parametrize (
30+ "mode,fixture" ,
31+ [("ap-ptp" , "airos_loco5ac_ap-ptp" ), ("sta-ptp" , "airos_loco5ac_sta-ptp" )],
32+ )
3033@pytest .mark .asyncio
31- async def test_ap_object (airos_device , base_url , mode ):
34+ async def test_ap_object (airos_device , base_url , mode , fixture ):
3235 """Test device operation."""
3336 cookie = SimpleCookie ()
3437 cookie ["session_id" ] = "test-cookie"
@@ -42,7 +45,7 @@ async def test_ap_object(airos_device, base_url, mode):
4245 mock_login_response .cookies = cookie
4346 mock_login_response .headers = {"X-CSRF-ID" : "test-csrf-token" }
4447 # --- Prepare fake GET /api/status response ---
45- fixture_data = await _read_fixture (mode )
48+ fixture_data = await _read_fixture (fixture )
4649 mock_status_payload = fixture_data
4750 mock_status_response = MagicMock ()
4851 mock_status_response .__aenter__ .return_value = mock_status_response
0 commit comments