Merge "Simplify setting up test notifier"

This commit is contained in:
Jenkins
2012-09-07 09:30:44 +00:00
committed by Gerrit Code Review
5 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ class BaseTestCase(test.TestCase):
def setUp(self):
super(BaseTestCase, self).setUp()
self.flags(compute_driver='nova.virt.fake.FakeDriver',
notification_driver=['nova.openstack.common.notifier.test_notifier'],
notification_driver=[test_notifier.__name__],
network_manager='nova.network.manager.FlatManager')
self.compute = importutils.import_object(FLAGS.compute_manager)
+1 -1
View File
@@ -166,7 +166,7 @@ class UsageInfoTestCase(test.TestCase):
fake_get_nw_info)
self.flags(compute_driver='nova.virt.fake.FakeDriver',
notification_driver=['nova.openstack.common.notifier.test_notifier'],
notification_driver=[test_notifier.__name__],
network_manager='nova.network.manager.FlatManager')
self.compute = importutils.import_object(FLAGS.compute_manager)
self.user_id = 'fake'
+1 -1
View File
@@ -54,7 +54,7 @@ class NotificationsTestCase(test.TestCase):
fake_network.set_stub_network_methods(self.stubs)
self.flags(compute_driver='nova.virt.fake.FakeDriver',
notification_driver=['nova.openstack.common.notifier.test_notifier'],
notification_driver=[test_notifier.__name__],
network_manager='nova.network.manager.FlatManager',
notify_on_state_change="vm_and_task_state",
host='testhost')
+2 -3
View File
@@ -51,9 +51,8 @@ class VolumeTestCase(test.TestCase):
self.compute = importutils.import_object(FLAGS.compute_manager)
vol_tmpdir = tempfile.mkdtemp()
self.flags(compute_driver='nova.virt.fake.FakeDriver',
volumes_dir=vol_tmpdir)
self.stubs.Set(nova.flags.FLAGS, 'notification_driver',
['nova.openstack.common.notifier.test_notifier'])
volumes_dir=vol_tmpdir,
notification_driver=[test_notifier.__name__])
self.stubs.Set(iscsi.TgtAdm, '_get_target', self.fake_get_target)
self.volume = importutils.import_object(FLAGS.volume_manager)
self.context = context.get_admin_context()
+2 -3
View File
@@ -38,9 +38,8 @@ class UsageInfoTestCase(test.TestCase):
def setUp(self):
super(UsageInfoTestCase, self).setUp()
self.flags(compute_driver='nova.virt.fake.FakeDriver',
host='fake')
self.stubs.Set(flags.FLAGS, 'notification_driver',
['nova.openstack.common.notifier.test_notifier'])
host='fake',
notification_driver=[test_notifier.__name__])
fake_network.set_stub_network_methods(self.stubs)
self.volume = importutils.import_object(FLAGS.volume_manager)