Documentation ¶
Overview ¶
Package aioxmpp facilitates integration testing against aioxmpp.
Tests are written by importing the automatically generated aioxmpp_client Python package, subclassing the Daemon class, and overriding its 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 aioxmpp_client import Daemon import aioxmpp class Ping(Daemon): def prepare_argparse(self) -> None: super().prepare_argparse() def jid(s): return aioxmpp.JID.fromstr(s) self.argparse.add_argument( "-j", type=jid, help="The JID to ping", ) async def run(self) -> None: await aioxmpp.ping.ping(self.client, self.args.j)
For more information see aioxmpp_client.py, python/xmpptest.py, and the aioxmpp 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 aioxmpp 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.