dbus_service_event_method#
- pytest_bluezenv.dbus_service_event_method(interface, name, args=(), in_signature='', out_signature='', sync=True)[source]#
dbus.service.method that pushes Event instances to self.events
- Parameters:
interface (
str) – D-Bus interface name.name (
str) – method name.args (
tuple) – argument names, passed to the event as properties.in_signature (
str) – D-Bus in-signature.out_signature (
str) – D-Bus out-signature of the reply, for asynchronous methods only. Only the string ("s") and uint32 ("u") replies are converted. Other non-empty signatures are not supported.sync (
bool) – whether the method replies synchronously. If false, the event carries reply/error callbacks forreply().
Example
# in a plugin using EventPluginMixin: a call becomes an event class AgentObject(dbus.service.Object): @utils.mainloop_assert def __init__(self, bus, path, events): self.events = events super().__init__(bus, path) AuthorizeService = dbus_service_event_method( "org.bluez.Agent1", "AuthorizeService", ("device", "uuid"), "os", sync=False ) # upper tester side: await the call by kind, then answer it event = host.agent.expect("org.bluez.Agent1.AuthorizeService") assert event.uuid == "0000110c-0000-1000-8000-00805f9b34fb" host.agent.reply()
- Returns:
decorated D-Bus service method.
- Return type:
callable