Documentation ¶
Overview ¶
Package slixmpp facilitates integration testing against slixmpp.
Tests are accomplished by importing the automatically generated slixmpp_client Python package, subclassing the Daemon class, and overriding the run method. Other methods can also be overridden, in particular the prepare_argparse method can be used to add command line arguments to the Python scripts. For example:
from slixmpp_client import Daemon import slixmpp class Ping(Daemon): def prepare_argparse(self) -> None: super().prepare_argparse() self.argparse.add_argument( "-j", type=slixmpp.jid.JID, help="The JID to ping", ) def configure(self): super().configure() self.client.register_plugin('xep_0199') # Ping async def run(self) -> None: await self.client.plugin['xep_0199'].ping(jid=self.args.j)
For more information see slixmpp_client.py, python/xmpptest.py, and the slixmpp documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Test ¶
func Test(ctx context.Context, t *testing.T, opts ...integration.Option) integration.SubtestRunner
Test starts the slixmpp wrapper script and returns a function that runs subtests using t.Run. Multiple calls to the returned function will result in uniquely named subtests. When all subtests have completed, the daemon is stopped.
Types ¶
This section is empty.