summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-05 19:11:19 +0100
committermathieui <mathieui@mathieui.net>2021-02-05 20:08:16 +0100
commit6c3f26161e78285696dba0002907529ad73fba72 (patch)
treec0bda4b5858d5e2a39ea7ae62f9754816d2604e9
parentd6ab3124cea389bc72d465cfe7a4306731eaaaa9 (diff)
downloadslixmpp-6c3f26161e78285696dba0002907529ad73fba72.tar.gz
slixmpp-6c3f26161e78285696dba0002907529ad73fba72.tar.bz2
slixmpp-6c3f26161e78285696dba0002907529ad73fba72.tar.xz
slixmpp-6c3f26161e78285696dba0002907529ad73fba72.zip
itests: allow pconfig registration with plugins
-rw-r--r--slixmpp/test/integration.py11
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"""