slixmpp

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 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

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.

Jump to

Keyboard shortcuts

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