88from mashumaro .exceptions import MissingField
99import pytest
1010
11- from airos .airos6 import AirOS
11+ from airos .airos6 import AirOS6
1212import airos .exceptions
1313
1414
1515@pytest .mark .skip (reason = "broken, needs investigation" )
1616@pytest .mark .asyncio
17- async def test_login_no_csrf_token (airos6_device : AirOS ) -> None :
17+ async def test_login_no_csrf_token (airos6_device : AirOS6 ) -> None :
1818 """Test login response without a CSRF token header."""
1919 cookie = SimpleCookie ()
2020 cookie ["AIROS_TOKEN" ] = "abc"
@@ -34,7 +34,7 @@ async def test_login_no_csrf_token(airos6_device: AirOS) -> None:
3434
3535
3636@pytest .mark .asyncio
37- async def test_login_connection_error (airos6_device : AirOS ) -> None :
37+ async def test_login_connection_error (airos6_device : AirOS6 ) -> None :
3838 """Test aiohttp ClientError during login attempt."""
3939 with (
4040 patch .object (airos6_device .session , "request" , side_effect = aiohttp .ClientError ),
@@ -45,7 +45,7 @@ async def test_login_connection_error(airos6_device: AirOS) -> None:
4545
4646# --- Tests for status() and derived_data() logic ---
4747@pytest .mark .asyncio
48- async def test_status_when_not_connected (airos6_device : AirOS ) -> None :
48+ async def test_status_when_not_connected (airos6_device : AirOS6 ) -> None :
4949 """Test calling status() before a successful login."""
5050 airos6_device .connected = False # Ensure connected state is false
5151 with pytest .raises (airos .exceptions .AirOSDeviceConnectionError ):
@@ -55,7 +55,7 @@ async def test_status_when_not_connected(airos6_device: AirOS) -> None:
5555# pylint: disable=pointless-string-statement
5656'''
5757@pytest.mark.asyncio
58- async def test_status_non_200_response(airos6_device: AirOS ) -> None:
58+ async def test_status_non_200_response(airos6_device: AirOS6 ) -> None:
5959 """Test status() with a non-successful HTTP response."""
6060 airos6_device.connected = True
6161 mock_status_response = MagicMock()
@@ -72,7 +72,7 @@ async def test_status_non_200_response(airos6_device: AirOS) -> None:
7272
7373
7474@pytest .mark .asyncio
75- async def test_status_invalid_json_response (airos6_device : AirOS ) -> None :
75+ async def test_status_invalid_json_response (airos6_device : AirOS6 ) -> None :
7676 """Test status() with a response that is not valid JSON."""
7777 airos6_device .connected = True
7878 mock_status_response = MagicMock ()
@@ -90,7 +90,7 @@ async def test_status_invalid_json_response(airos6_device: AirOS) -> None:
9090
9191
9292@pytest .mark .asyncio
93- async def test_status_missing_interface_key_data (airos6_device : AirOS ) -> None :
93+ async def test_status_missing_interface_key_data (airos6_device : AirOS6 ) -> None :
9494 """Test status() with a response missing critical data fields."""
9595 airos6_device .connected = True
9696 # The derived_data() function is called with a mocked response
@@ -111,15 +111,15 @@ async def test_status_missing_interface_key_data(airos6_device: AirOS) -> None:
111111
112112
113113@pytest .mark .asyncio
114- async def test_derived_data_no_interfaces_key (airos6_device : AirOS ) -> None :
114+ async def test_derived_data_no_interfaces_key (airos6_device : AirOS6 ) -> None :
115115 """Test derived_data() with a response that has no 'interfaces' key."""
116116 # This will directly test the 'if not interfaces:' branch (line 206)
117117 with pytest .raises (airos .exceptions .AirOSKeyDataMissingError ):
118118 airos6_device .derived_data ({})
119119
120120
121121@pytest .mark .asyncio
122- async def test_derived_data_no_br0_eth0_ath0 (airos6_device : AirOS ) -> None :
122+ async def test_derived_data_no_br0_eth0_ath0 (airos6_device : AirOS6 ) -> None :
123123 """Test derived_data() with an unexpected interface list, to test the fallback logic."""
124124 fixture_data = {
125125 "interfaces" : [
@@ -134,7 +134,7 @@ async def test_derived_data_no_br0_eth0_ath0(airos6_device: AirOS) -> None:
134134
135135@pytest .mark .skip (reason = "broken, needs investigation" )
136136@pytest .mark .asyncio
137- async def test_status_missing_required_key_in_json (airos6_device : AirOS ) -> None :
137+ async def test_status_missing_required_key_in_json (airos6_device : AirOS6 ) -> None :
138138 """Test status() with a response missing a key required by the dataclass."""
139139 airos6_device .connected = True
140140 # Fixture is valid JSON, but is missing the entire 'wireless' block,
0 commit comments