File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -224,3 +224,10 @@ def test_handle_reply_unexpected(app):
224224 assert app .handle_message .call_args [0 ][6 ] == tsn
225225 assert app .handle_message .call_args [0 ][7 ] == mock .sentinel .command_id
226226 assert app .handle_message .call_args [0 ][8 ] == mock .sentinel .args
227+
228+
229+ @pytest .mark .asyncio
230+ async def test_shutdown (app ):
231+ app ._api .close = mock .MagicMock ()
232+ await app .shutdown ()
233+ assert app ._api .close .call_count == 1
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ async def _reset_watchdog(self):
3535 await self ._api .write_parameter (NETWORK_PARAMETER ['watchdog_ttl' ][0 ], 3600 )
3636 await asyncio .sleep (1200 )
3737
38+ async def shutdown (self ):
39+ """Shutdown application."""
40+ self ._api .close ()
41+
3842 async def startup (self , auto_form = False ):
3943 """Perform a complete application startup"""
4044 r = await self ._api .version ()
You can’t perform that action at this time.
0 commit comments