pytest_bluezenv.Agent#
- class pytest_bluezenv.Agent(capability='KeyboardDisplay', path='/agent')[source]#
Host plugin providing org.bluez.Agent1 test implementation.
Asynchronous events are handled via expect().
Example
host.agent.device_method(host1.bdaddr, "Pair") event = host.agent.expect("org.bluez.Agent1.RequestConfirmation") assert event.passkey == 1234 host.agent.reply()
- __init__(capability='KeyboardDisplay', path='/agent')[source]#
Configure plugin (runs on parent host side). This is called at test discovery time, so should mainly store static data.
Methods
__init__([capability, path])Configure plugin (runs on parent host side).
adapter_get(key)Get given org.bluez.Adapter1 property
adapter_method(method, *a, **kw)Call given org.bluez.Adapter1 DBus method
adapter_set(key, value)Set given org.bluez.Adapter1 property
device_method(address, method, *a, **kw)Call given org.bluez.Device1 DBus method
expect(kinds)Get most recent pending Event and assert its kind
get_event([block])Get most recent pending Event, blocking optional
has_device(address)Return True if device with given address exists
presetup(config)Parent host-side setup, before VM environment is started.
reply(*value)Provide DBus reply to the most recent pending Event
reply_error([err])Provide DBus error reply to the most recent pending Event
setup(impl)VM-side setup
teardown()VM-side teardown
Attributes
- depends = [<pytest_bluezenv.host_plugins.Bluetoothd object>]
- name = 'agent'
- value = None