From: Benjamin Braatz Date: Sun, 21 Mar 2021 16:35:30 +0000 (+0100) Subject: Add wait parameter to test function. X-Git-Tag: v0.3.0~45 X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=75e339b54c5bd1656f2e7cbbfc1a6f85529f24c1;p=graphit%2Fcontrolpi.git Add wait parameter to test function. --- diff --git a/controlpi/__init__.py b/controlpi/__init__.py index 658b775..227672b 100644 --- a/controlpi/__init__.py +++ b/controlpi/__init__.py @@ -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()