From 9c49da6887eaff67d19fe0d12fb1046dde3bdaec Mon Sep 17 00:00:00 2001 From: Ayumu Ueha Date: Tue, 9 Aug 2022 14:07:21 +0000 Subject: Fix logging notifier unit test For unknown reasons, the `create_notifier()` in `test_api_request_no_messaging()` used `oslo_messaging.Notifier` instead of the `_LogNotifier` that should be originally used, causing unit test to fail. This patch fixes this issue by changing `use_oslo_messaging` config to False for this test. Change-Id: I32f9dc596525e912e37984764f68564e26ecfd3b --- keystonemiddleware/tests/unit/audit/test_logging_notifier.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keystonemiddleware/tests/unit/audit/test_logging_notifier.py b/keystonemiddleware/tests/unit/audit/test_logging_notifier.py index f734061..fafd4c7 100644 --- a/keystonemiddleware/tests/unit/audit/test_logging_notifier.py +++ b/keystonemiddleware/tests/unit/audit/test_logging_notifier.py @@ -27,6 +27,8 @@ class TestLoggingNotifier(base.BaseAuditMiddlewareTest): super(TestLoggingNotifier, self).setUp() def test_api_request_no_messaging(self): + self.cfg.config(use_oslo_messaging=False, + group='audit_middleware_notifications') app = self.create_simple_app() with mock.patch('keystonemiddleware.audit._LOG.info') as log: -- cgit v1.2.1