qubes: fix/update event names

Fix few typos, then rename:
 - recreate-appmenus -> domain-restore: there may be more to do than
 only appmenus
This commit is contained in:
Marek Marczykowski-Górecki 2016-04-03 03:40:41 +02:00 committed by Wojtek Porczyk
parent 7cbe2dbd38
commit 06c315c94b
3 changed files with 7 additions and 7 deletions

View File

@ -59,9 +59,9 @@ class DeviceCollection(object):
raise KeyError(
'device {!r} of class {} already attached to {!r}'.format(
device, self._class, self._vm))
self._vm.fire_event_pre('device-pre-attach' + self._class, device)
self._vm.fire_event_pre('device-pre-attach:' + self._class, device)
self._set.add(device)
self._vm.fire_event('device-attach' + self._class, device)
self._vm.fire_event('device-attach:' + self._class, device)
def detach(self, device):
@ -74,9 +74,9 @@ class DeviceCollection(object):
raise KeyError(
'device {!r} of class {} not attached to {!r}'.format(
device, self._class, self._vm))
self._vm.fire_event_pre('device-pre-detach:{}' + self._class, device)
self._vm.fire_event_pre('device-pre-detach:' + self._class, device)
self._set.remove(device)
self._vm.fire_event('device-detach' + self._class, device)
self._vm.fire_event('device-detach:' + self._class, device)
def __iter__(self):

View File

@ -78,5 +78,5 @@ class TC_01_DeviceManager(qubes.tests.QubesTestCase):
def test_001_missing(self):
self.manager['testclass'].attach('testdev')
self.assertEventFired(self.emitter, 'device-attached:testclass')
self.assertEventFired(self.emitter, 'device-attach:testclass')

View File

@ -72,7 +72,7 @@ class TC_30_VMCollection(qubes.tests.QubesTestCase):
self.vms.add(self.testvm1)
self.assertIn(1, self.vms)
self.assertEventFired(self.app, 'domain-added', args=[self.testvm1])
self.assertEventFired(self.app, 'domain-add', args=[self.testvm1])
with self.assertRaises(TypeError):
self.vms.add(object())
@ -125,7 +125,7 @@ class TC_30_VMCollection(qubes.tests.QubesTestCase):
del self.vms['testvm2']
self.assertItemsEqual(self.vms.vms(), [self.testvm1])
self.assertEventFired(self.app, 'domain-deleted', args=[self.testvm2])
self.assertEventFired(self.app, 'domain-delete', args=[self.testvm2])
def test_100_get_new_unused_qid(self):
self.vms.add(self.testvm1)