File: utils.py

package info (click to toggle)
at-spi2-core 2.57.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,140 kB
  • sloc: ansic: 44,803; xml: 1,480; python: 387; sh: 239; makefile: 28; javascript: 13
file content (11 lines) | stat: -rw-r--r-- 371 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
import pytest
import dbus

PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'

def get_property(proxy, iface_name, prop_name):
    return proxy.Get(iface_name, prop_name, dbus_interface=PROPERTIES_IFACE)

def check_unknown_property_yields_error(obj, iface):
    with pytest.raises(dbus.exceptions.DBusException):
        get_property(obj, iface, 'NonexistentProperty')