From 6c3f26161e78285696dba0002907529ad73fba72 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 5 Feb 2021 19:11:19 +0100 Subject: itests: allow pconfig registration with plugins --- slixmpp/test/integration.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'slixmpp/test') diff --git a/slixmpp/test/integration.py b/slixmpp/test/integration.py index 758ad239..7da3f86a 100644 --- a/slixmpp/test/integration.py +++ b/slixmpp/test/integration.py @@ -16,7 +16,9 @@ except ImportError: # not usable. from unittest import TestCase as IsolatedAsyncioTestCase from typing import ( + Dict, List, + Optional, ) from slixmpp import JID @@ -39,11 +41,14 @@ class SlixIntegration(IsolatedAsyncioTestCase): """get a str from an env var""" return os.getenv(name) - def register_plugins(self, plugins: List[str]): + def register_plugins(self, plugins: List[str], configs: Optional[List[Dict]] = None): """Register plugins on all known clients""" - for plugin in plugins: + for index, plugin in enumerate(plugins): for client in self.clients: - client.register_plugin(plugin) + if configs is not None: + client.register_plugin(plugin, pconfig=configs[index]) + else: + client.register_plugin(plugin) def add_client(self, jid: JID, password: str): """Register a new client""" -- cgit v1.2.3