From 06c315c94bf80336a74d076a8fd0f5c72fcf6b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 3 Apr 2016 03:40:41 +0200 Subject: [PATCH] qubes: fix/update event names Fix few typos, then rename: - recreate-appmenus -> domain-restore: there may be more to do than only appmenus --- qubes/devices.py | 8 ++++---- qubes/tests/devices.py | 2 +- qubes/tests/init2.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qubes/devices.py b/qubes/devices.py index 707ba834..0911344f 100644 --- a/qubes/devices.py +++ b/qubes/devices.py @@ -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): diff --git a/qubes/tests/devices.py b/qubes/tests/devices.py index f4aa3be7..ebd4332b 100644 --- a/qubes/tests/devices.py +++ b/qubes/tests/devices.py @@ -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') diff --git a/qubes/tests/init2.py b/qubes/tests/init2.py index c562a780..0847b572 100644 --- a/qubes/tests/init2.py +++ b/qubes/tests/init2.py @@ -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)