summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_plugin.py
diff options
context:
space:
mode:
authorAndrew Bogott <abogott@wikimedia.org>2012-07-19 03:34:31 -0500
committerAndrew Bogott <abogott@wikimedia.org>2012-08-02 18:11:37 -0500
commitc767e9beffe4b826eac869ce7e2eef2cc1499bbe (patch)
tree71e7bb4e8495db8e924ab355483781df32a6190e /tests/unit/test_plugin.py
parentbcb424dd730a977aeaae9f6e33e9bb35cbc0c062 (diff)
downloadoslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.tar.gz
oslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.tar.xz
oslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.zip
Add multiple-driver support to the notifier api.
Move all of the functionality previously provided by the list_notifier into the basic notifier api. Move and restructure tests accordingly. Remove the list_notifier file and test file. For bug 1025820 Change-Id: Idf7cb975dd78e9951188781622a4d10ca466b154
Diffstat (limited to 'tests/unit/test_plugin.py')
-rw-r--r--tests/unit/test_plugin.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/tests/unit/test_plugin.py b/tests/unit/test_plugin.py
index 31f2e7a..b68d6f5 100644
--- a/tests/unit/test_plugin.py
+++ b/tests/unit/test_plugin.py
@@ -17,9 +17,7 @@ import pkg_resources
import unittest
from openstack.common import cfg
-from openstack.common import notifier
from openstack.common.notifier import api as notifier_api
-from openstack.common.notifier import no_op_notifier
from openstack.common.plugin import plugin
from openstack.common.plugin import pluginmanager
from tests import utils as test_utils
@@ -34,12 +32,6 @@ class SimpleNotifier(object):
self.message_list.append(message)
-class SimplerNotifier(object):
- def notify(self, context, message):
- global simpler_notify_called
- simpler_notify_called = True
-
-
class ManagerTestCase(test_utils.BaseTestCase):
def tearDown(self):
super(ManagerTestCase, self).tearDown()
@@ -54,15 +46,9 @@ class NotifyTestCase(test_utils.BaseTestCase):
def setUp(self):
super(NotifyTestCase, self).setUp()
- # Set up a 'normal' notifier to make sure the plugin logic
- # doesn't mess anything up.
- self.stubs.Set(cfg.CONF, 'notification_driver',
- SimplerNotifier())
- global simpler_notify_called
- simpler_notify_called = False
-
def tearDown(self):
super(NotifyTestCase, self).tearDown()
+ notifier_api._reset_drivers()
def test_add_notifier(self):
notifier1 = SimpleNotifier()
@@ -95,11 +81,6 @@ class NotifyTestCase(test_utils.BaseTestCase):
self.assertEqual(len(notifier.message_list), 1)
- # Verify that the original baseline notifier is still
- # installed and working.
- global simpler_notify_called
- self.assertTrue(simpler_notify_called)
-
class StubControllerExtension(object):
name = 'stubextension'