Add wait parameter to test function.
authorBenjamin Braatz <bb@bbraatz.eu>
Sun, 21 Mar 2021 16:35:30 +0000 (17:35 +0100)
committerBenjamin Braatz <bb@bbraatz.eu>
Sun, 21 Mar 2021 16:35:30 +0000 (17:35 +0100)
controlpi/__init__.py

index 658b7754684fe3e1e476f123899c5db4a45c7042..227672b384117e183b1ae6c174ac07232fed744f 100644 (file)
@@ -94,7 +94,8 @@ async def run(conf: Dict[str, PluginConf]) -> None:
 
 
 async def test(conf: Dict[str, PluginConf],
-               messages: List[Dict[str, Any]]) -> None:
+               messages: List[Dict[str, Any]],
+               wait: float = 0.0) -> None:
     """Test configuration of ControlPi system.
 
     Setup message bus, process given configuration, run message bus and
@@ -170,4 +171,5 @@ async def test(conf: Dict[str, PluginConf],
         await message_bus.send(Message('test()', message))
         # Give immediate reactions to messages opportunity to happen:
         await asyncio.sleep(0)
+    await asyncio.sleep(wait)
     await message_bus._queue.join()