File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,24 @@ async def test_event_received_callback_invoked(
197197 assert event .zone == 3
198198
199199
200+ @pytest .mark .asyncio
201+ async def test_stream_events_receives_event (
202+ client : Client , connection : Connection , alarm : Alarm
203+ ) -> None :
204+ """Integration: stream_events yields when a system status packet arrives."""
205+ stream = client .stream_events ()
206+ task = asyncio .create_task (stream .__anext__ ())
207+
208+ # Feed a SystemStatusEvent: Zone 3 unsealed
209+ await _feed_ascii (client , connection , "87020361000301080510234500E5" )
210+
211+ event = await asyncio .wait_for (task , 1.0 )
212+ assert isinstance (event , SystemStatusEvent )
213+ assert event .type == SystemStatusEvent .EventType .UNSEALED
214+ assert event .zone == 3
215+ await stream .aclose ()
216+
217+
200218@pytest .fixture
201219def alarm () -> Alarm :
202220 return Alarm ()
You can’t perform that action at this time.
0 commit comments