Event#

class pytest_bluezenv.Event(kind, reply_cb=None, error_cb=None, reply_type=None, info=None, **kw)[source]#

Asynchronous event.

The D-Bus method arguments are exposed as attributes, so an incoming RequestConfirmation event has event.passkey. For an outgoing method call, a :reply event exposes the call return values as event.values and an :error event exposes the exception as event.error.

Parameters:
  • kind (str) – event kind, matched by expect().

  • reply_cb (callable) – callback for a successful reply.

  • error_cb (callable) – callback for an error reply.

  • reply_type (callable) – converter for reply values.

  • info (dict) – event properties, also accessible as attributes.

  • **kw – extra properties merged into info.

Example

event = host.agent.expect("org.bluez.Agent1.RequestConfirmation")
assert event.passkey == 1234
kind#

event kind

Type:

str

info#

event properties (also available as attributes)

Type:

dict

reply_cb#

callback for an asynchronous D-Bus reply.

Type:

callable

error_cb#

callback for an asynchronous D-Bus error.

Type:

callable

reply_type#

converter for reply values.

Type:

callable

__init__(kind, reply_cb=None, error_cb=None, reply_type=None, info=None, **kw)[source]#

Methods