mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-27 01:58:19 +02:00
linux: Parent Bluetooth mouse test devices properly
This commit is contained in:
parent
e3b6e1426b
commit
e8e20ac64a
1 changed files with 34 additions and 11 deletions
|
|
@ -767,21 +767,31 @@ class Tests(unittest.TestCase):
|
|||
def test_bluetooth_hid_mouse(self):
|
||||
'''bluetooth HID mouse battery'''
|
||||
|
||||
self.testbed.add_device('hid',
|
||||
'usb1/bluetooth/hci0/hci0:01',
|
||||
None,
|
||||
[], [])
|
||||
|
||||
self.testbed.add_device(
|
||||
'input',
|
||||
'usb1/bluetooth/hci0/hci0:01/input/input2/mouse3',
|
||||
dev = self.testbed.add_device(
|
||||
'bluetooth',
|
||||
'/devices/pci0000:00/0000:00:14.0/usb2/2-7/2-7:1.0/bluetooth/hci0',
|
||||
None,
|
||||
[], ['DEVNAME', 'input/mouse3', 'ID_INPUT_MOUSE', '1'])
|
||||
[], [])
|
||||
|
||||
parent = dev
|
||||
dev = self.testbed.add_device(
|
||||
'bluetooth',
|
||||
'hci0:256',
|
||||
parent,
|
||||
[], ['DEVTYPE', 'link'])
|
||||
|
||||
parent = dev
|
||||
dev = self.testbed.add_device(
|
||||
'hid',
|
||||
'0005:046D:B00D.0002',
|
||||
parent,
|
||||
[], ['HID_NAME', 'Fancy BT Mouse'])
|
||||
|
||||
parent = dev
|
||||
self.testbed.add_device(
|
||||
'power_supply',
|
||||
'usb1/bluetooth/hci0/hci0:01/1/power_supply/hid-00:11:22:33:44:55-battery',
|
||||
None,
|
||||
'power_supply/hid-00:1f:20:96:33:47-battery',
|
||||
parent,
|
||||
['type', 'Battery',
|
||||
'scope', 'Device',
|
||||
'present', '1',
|
||||
|
|
@ -791,6 +801,19 @@ class Tests(unittest.TestCase):
|
|||
'model_name', 'Fancy BT mouse'],
|
||||
[])
|
||||
|
||||
dev = self.testbed.add_device(
|
||||
'input',
|
||||
'input/input22',
|
||||
parent,
|
||||
[], ['ID_INPUT_MOUSE', '1'])
|
||||
|
||||
parent = dev
|
||||
self.testbed.add_device(
|
||||
'input',
|
||||
'mouse1',
|
||||
parent,
|
||||
[], ['ID_INPUT_MOUSE', '1'])
|
||||
|
||||
self.start_daemon()
|
||||
devs = self.proxy.EnumerateDevices()
|
||||
self.assertEqual(len(devs), 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue