mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-08 03:08:03 +02:00
linux: Make test compatible with older dbusmock versions
The changes from 37b6d4b039 ("linux: Fix Bluetooth tests for
python-dbusmock changes") require a not-yet-released dbusmock version.
Simply catch the error and fall back to adding the properties in order
to be compatible with both old and new dbusmock versions of the bluez
service.
This commit is contained in:
parent
50bdbe7e65
commit
94af9d6f3d
1 changed files with 5 additions and 1 deletions
|
|
@ -1745,7 +1745,11 @@ class Tests(dbusmock.DBusTestCase):
|
|||
device = self.dbus_con.get_object('org.bluez', path)
|
||||
|
||||
if device_properties:
|
||||
device.UpdateProperties(DEVICE_IFACE, device_properties)
|
||||
try:
|
||||
# The properties are only installed for umockdev newer than 0.25.0
|
||||
device.UpdateProperties(DEVICE_IFACE, device_properties)
|
||||
except dbus.exceptions.DBusException:
|
||||
device.AddProperties(DEVICE_IFACE, device_properties)
|
||||
|
||||
battery_properties = {
|
||||
'Percentage': dbus.Byte(battery_level, variant_level=1),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue