@@ -77,7 +77,7 @@ class DummyTransport:
7777 def __init__ (
7878 self ,
7979 loop : asyncio .AbstractEventLoop ,
80- test_data : dict [bytes , tuple [str , bytes , bytes ]] | None = None ,
80+ test_data : dict [bytes , tuple [str , bytes , bytes | None ]] | None = None ,
8181 ) -> None :
8282 """Initialize dummy transport class."""
8383 self ._loop = loop
@@ -169,7 +169,7 @@ class MockSerial:
169169 """Mock serial connection."""
170170
171171 def __init__ (
172- self , custom_response : dict [bytes , tuple [str , bytes , bytes ]] | None
172+ self , custom_response : dict [bytes , tuple [str , bytes , bytes | None ]] | None
173173 ) -> None :
174174 """Init mocked serial connection."""
175175 self .custom_response = custom_response
@@ -421,7 +421,7 @@ async def test_stick_connect_timeout(self, monkeypatch: pytest.MonkeyPatch) -> N
421421 b"\x05 \x05 \x03 \x03 000AB43C\r \n " : (
422422 "STICK INIT timeout" ,
423423 b"000000E1" , # Timeout ack
424- b"" ,
424+ None ,
425425 ),
426426 }
427427 ).mock_connection ,
@@ -526,6 +526,7 @@ async def node_loaded(self, event: pw_api.NodeEvent, mac: str) -> None: # type:
526526 f"Invalid { event } event, expected " + f"{ pw_api .NodeEvent .LOADED } "
527527 )
528528 )
529+
529530 async def node_motion_state (
530531 self ,
531532 feature : pw_api .NodeFeature , # type: ignore[name-defined]
@@ -1497,7 +1498,7 @@ async def test_stick_network_down(self, monkeypatch: pytest.MonkeyPatch) -> None
14971498 def fake_env (self , env : str ) -> str | None :
14981499 """Fake environment."""
14991500 if env == "APPDATA" :
1500- return "c: \\ user \\ tst \\ appdata "
1501+ return "appdata_folder "
15011502 if env == "~" :
15021503 return "/home/usr"
15031504 return None
@@ -2125,7 +2126,6 @@ def fake_cache(dummy: object, setting: str) -> str | None:
21252126 construct_message (b"0100555555555555555500BF" , b"0000" )
21262127 )
21272128
2128-
21292129 async def load_callback (event : pw_api .NodeEvent , mac : str ) -> None : # type: ignore[name-defined]
21302130 """Load callback for event."""
21312131
@@ -2418,12 +2418,22 @@ async def test_node_discovery_and_load(
24182418 # Get state
24192419 get_state_timestamp = dt .now (UTC ).replace (minute = 0 , second = 0 , microsecond = 0 )
24202420 state = await stick .nodes ["0098765432101234" ].get_state (
2421- (pw_api .NodeFeature .AVAILABLE , pw_api .NodeFeature .PING , pw_api .NodeFeature .INFO , pw_api .NodeFeature .RELAY )
2421+ (
2422+ pw_api .NodeFeature .AVAILABLE ,
2423+ pw_api .NodeFeature .PING ,
2424+ pw_api .NodeFeature .INFO ,
2425+ pw_api .NodeFeature .RELAY ,
2426+ )
24222427 )
24232428
24242429 # Check Available
24252430 assert state [pw_api .NodeFeature .AVAILABLE ].state
2426- assert state [pw_api .NodeFeature .AVAILABLE ].last_seen .replace (minute = 0 , second = 0 , microsecond = 0 ) == get_state_timestamp
2431+ assert (
2432+ state [pw_api .NodeFeature .AVAILABLE ].last_seen .replace (
2433+ minute = 0 , second = 0 , microsecond = 0
2434+ )
2435+ == get_state_timestamp
2436+ )
24272437
24282438 # Check Ping
24292439 assert state [pw_api .NodeFeature .PING ].rssi_in == 69
0 commit comments