itests: allow pconfig registration with plugins
This commit is contained in:
parent
d6ab3124ce
commit
6c3f26161e
1 changed files with 8 additions and 3 deletions
|
@ -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,10 +41,13 @@ 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:
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue