@@ -643,46 +643,46 @@ async def test_stick_node_discovered_subscription(
643643
644644 await stick .disconnect ()
645645
646- async def node_join (self , event : pw_api .NodeEvent , mac : str ) -> None : # type: ignore[name-defined]
647- """Handle join event callback."""
648- if event == pw_api .NodeEvent .JOIN :
649- self .test_node_join .set_result (mac )
650- else :
651- self .test_node_join .set_exception (
652- BaseException (
653- f"Invalid { event } event, expected " + f"{ pw_api .NodeEvent .JOIN } "
654- )
655- )
656-
657- @pytest .mark .asyncio
658- async def test_stick_node_join_subscription (
659- self , monkeypatch : pytest .MonkeyPatch
660- ) -> None :
661- """Testing "new_node" subscription."""
662- mock_serial = MockSerial (None )
663- monkeypatch .setattr (
664- pw_connection_manager ,
665- "create_serial_connection" ,
666- mock_serial .mock_connection ,
667- )
668- monkeypatch .setattr (pw_sender , "STICK_TIME_OUT" , 0.1 )
669- monkeypatch .setattr (pw_requests , "NODE_TIME_OUT" , 0.5 )
670- stick = pw_stick .Stick ("test_port" , cache_enabled = False )
671- await stick .connect ()
672- await stick .initialize ()
673- await stick .discover_nodes (load = False )
674- self .test_node_join = asyncio .Future ()
675- unusb_join = stick .subscribe_to_node_events (
676- node_event_callback = self .node_join ,
677- events = (pw_api .NodeEvent .JOIN ,),
678- )
679-
680- # Inject node join request message
681- mock_serial .inject_message (b"00069999999999999999" , b"FFFC" )
682- mac_join_node = await self .test_node_join
683- assert mac_join_node == "9999999999999999"
684- unusb_join ()
685- await stick .disconnect ()
646+ # async def node_join(self, event: pw_api.NodeEvent, mac: str) -> None: # type: ignore[name-defined]
647+ # """Handle join event callback."""
648+ # if event == pw_api.NodeEvent.JOIN:
649+ # self.test_node_join.set_result(mac)
650+ # else:
651+ # self.test_node_join.set_exception(
652+ # BaseException(
653+ # f"Invalid {event} event, expected " + f"{pw_api.NodeEvent.JOIN}"
654+ # )
655+ # )
656+ #
657+ # @pytest.mark.asyncio
658+ # async def test_stick_node_join_subscription(
659+ # self, monkeypatch: pytest.MonkeyPatch
660+ # ) -> None:
661+ # """Testing "new_node" subscription."""
662+ # mock_serial = MockSerial(None)
663+ # monkeypatch.setattr(
664+ # pw_connection_manager,
665+ # "create_serial_connection",
666+ # mock_serial.mock_connection,
667+ # )
668+ # monkeypatch.setattr(pw_sender, "STICK_TIME_OUT", 0.1)
669+ # monkeypatch.setattr(pw_requests, "NODE_TIME_OUT", 0.5)
670+ # stick = pw_stick.Stick("test_port", cache_enabled=False)
671+ # await stick.connect()
672+ # await stick.initialize()
673+ # await stick.discover_nodes(load=False)
674+ # self.test_node_join = asyncio.Future()
675+ # unusb_join = stick.subscribe_to_node_events(
676+ # node_event_callback=self.node_join,
677+ # events=(pw_api.NodeEvent.JOIN,),
678+ # )
679+ #
680+ # # Inject node join request message
681+ # mock_serial.inject_message(b"00069999999999999999", b"FFFC")
682+ # mac_join_node = await self.test_node_join
683+ # assert mac_join_node == "9999999999999999"
684+ # unusb_join()
685+ # await stick.disconnect()
686686
687687 @pytest .mark .asyncio
688688 async def test_node_discovery (self , monkeypatch : pytest .MonkeyPatch ) -> None :
0 commit comments