diff options
author | mathieui <mathieui@mathieui.net> | 2021-02-05 20:14:41 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-02-05 20:14:41 +0100 |
commit | cff4588499d74e392cab646a46217f069cb1ef01 (patch) | |
tree | e349f9d4b1f13b57d4df820b8f649c8deee2a726 /slixmpp/test | |
parent | c82e1a4039dbf5d24990d28d665ba973fc9c9de7 (diff) | |
parent | 89601289fea2c6f2b47002926eb2609bd72d2a17 (diff) | |
download | slixmpp-cff4588499d74e392cab646a46217f069cb1ef01.tar.gz slixmpp-cff4588499d74e392cab646a46217f069cb1ef01.tar.bz2 slixmpp-cff4588499d74e392cab646a46217f069cb1ef01.tar.xz slixmpp-cff4588499d74e392cab646a46217f069cb1ef01.zip |
Merge branch 'updat-typing-and-generic-args' into 'master'
Update typing and generic args for plugins (step 1)
See merge request poezio/slixmpp!120
Diffstat (limited to 'slixmpp/test')
-rw-r--r-- | slixmpp/test/integration.py | 11 |
1 files changed, 8 insertions, 3 deletions
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""" |