diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-01-08 19:27:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-08 19:27:08 +0000 |
| commit | 4679038cca4f3192ed2dd16d795de0eac81d9992 (patch) | |
| tree | f06c2650a03a619280376d71c4db099477c799af /tests | |
| parent | 5df2184cd0424e7034464ff387a86266b93e9bf5 (diff) | |
| parent | fb56e513a78eca6017fbf1d7543126d1153aea86 (diff) | |
| download | oslo-4679038cca4f3192ed2dd16d795de0eac81d9992.tar.gz oslo-4679038cca4f3192ed2dd16d795de0eac81d9992.tar.xz oslo-4679038cca4f3192ed2dd16d795de0eac81d9992.zip | |
Merge "Fix publish_errors unit test"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_notifier.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/unit/test_notifier.py b/tests/unit/test_notifier.py index be58da2..1783d06 100644 --- a/tests/unit/test_notifier.py +++ b/tests/unit/test_notifier.py @@ -122,17 +122,18 @@ class NotifierTestCase(test_utils.BaseTestCase): self.assertEqual(self.test_topic, 'testnotify.debug') def test_error_notification(self): - self.stubs.Set(cfg.CONF, 'notification_driver', - ['openstack.common.notifier.rabbit_notifier']) - self.stubs.Set(cfg.CONF, 'publish_errors', True) - LOG = log.getLogger('common') - log.setup(None) + self.config(publish_errors=True, + use_stderr=False) + + def mock_notify(context, message): + msgs.append(message) + msgs = [] + self.stubs.Set(no_op_notifier, 'notify', mock_notify) - def mock_notify(context, topic, data): - msgs.append(data) + LOG = log.getLogger('test_error_notification.common') + log.setup('test_error_notification') - self.stubs.Set(rpc, 'notify', mock_notify) LOG.error('foo') self.assertEqual(1, len(msgs)) msg = msgs[0] |
