Skip to content

Commit

Permalink
q-dev: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed May 21, 2024
1 parent 8a11479 commit 1600fd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions qubesadmin/tests/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_000_available(self):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(
dev.description, 'unknown test device (unknown vendor)')
dev.description, '?******: unknown vendor unknown test device')
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
Expand All @@ -62,7 +62,7 @@ def test_001_available_desc(self):
self.assertIsInstance(dev, qubesadmin.device_protocol.DeviceInfo)
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'test-device (itl)')
self.assertEqual(dev.description, '?******: itl test-device')
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')

Expand All @@ -76,7 +76,7 @@ def test_002_available_options(self):
self.assertIsInstance(dev, qubesadmin.device_protocol.DeviceInfo)
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'test-device (itl)')
self.assertEqual(dev.description, '?******: itl test-device')
self.assertEqual(dev.data, {'ro': 'True', 'other': '123'})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
Expand All @@ -89,7 +89,7 @@ def test_010_getitem(self):
self.assertIsInstance(dev, qubesadmin.device_protocol.DeviceInfo)
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'test-device (itl)')
self.assertEqual(dev.description, '?******: itl test-device')
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
Expand All @@ -103,7 +103,7 @@ def test_011_getitem_missing(self):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev2')
self.assertEqual(dev.description,
'unknown test device (unknown vendor)')
'?******: unknown vendor unknown test device')
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev2')
self.assertAllCalled()
Expand Down
8 changes: 4 additions & 4 deletions qubesadmin/tests/tools/qvm_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def test_000_list_all(self):
['testclass', 'list'], app=self.app)
self.assertEqual(
[x.rstrip() for x in buf.getvalue().splitlines()],
['test-vm1:dev1 test-device (itl)',
'test-vm2:dev2 test-device (? `)']
['test-vm1:dev1 ?******: itl test-device',
'test-vm2:dev2 ?******: ? ` test-device']
)

def test_001_list_assigned_required(self):
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_001_list_assigned_required(self):
['testclass', 'list', 'test-vm3'], app=self.app)
self.assertEqual(
buf.getvalue(),
'test-vm1:dev1 test-device (itl) test-vm3\n'
'test-vm1:dev1 ?******: itl test-device test-vm3\n'
)

def test_002_list_attach(self):
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_002_list_attach(self):
['testclass', 'list', 'test-vm3'], app=self.app)
self.assertEqual(
buf.getvalue(),
'test-vm1:dev1 test-device (itl) test-vm3\n'
'test-vm1:dev1 ?******: itl test-device test-vm3\n'
)

def test_003_list_device_classes(self):
Expand Down

0 comments on commit 1600fd6

Please sign in to comment.