aioxmpp

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL