tests/devices: add test for handling listing device classes

This commit is contained in:
Frédéric Pierret (fepitre) 2019-08-06 14:41:23 +02:00
parent 07ca511bd7
commit 4d0545405f
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -306,3 +306,13 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.app.domains['test-vm2'], 'test', 'dev1') self.app.domains['test-vm2'], 'test', 'dev1')
self.vm.devices['test'].update_persistent(dev, False) self.vm.devices['test'].update_persistent(dev, False)
self.assertAllCalled() self.assertAllCalled()
def test_072_list(self):
self.app.expected_calls[
('dom0', 'admin.deviceclass.List', None, None)] = \
b'0\x00block\nmic\nusb\n'
seen = set()
for devclass in self.app.domains['test-vm'].devices:
self.assertNotIn(devclass, seen)
seen.add(devclass)
self.assertEqual(seen, {'block', 'mic', 'usb'})