summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_messaging/tests/drivers/test_impl_rabbit.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py
index 9212196..39a90a0 100644
--- a/oslo_messaging/tests/drivers/test_impl_rabbit.py
+++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py
@@ -21,6 +21,7 @@ import uuid
import fixtures
import kombu
+import kombu.connection
import kombu.transport.memory
from oslo_serialization import jsonutils
from oslo_utils import eventletutils
@@ -972,13 +973,19 @@ class RpcKombuHATestCase(test_utils.BaseTestCase):
'kombu.connection.Connection.connection'))
self.useFixture(fixtures.MockPatch(
'kombu.connection.Connection.channel'))
+ # TODO(stephenfin): Drop hasattr when we drop support for kombo < 4.6.8
+ if hasattr(kombu.connection.Connection, '_connection_factory'):
+ self.useFixture(fixtures.MockPatch(
+ 'kombu.connection.Connection._connection_factory'))
# starting from the first broker in the list
url = oslo_messaging.TransportURL.parse(self.conf, None)
self.connection = rabbit_driver.Connection(self.conf, url,
driver_common.PURPOSE_SEND)
- self.useFixture(fixtures.MockPatch(
- 'kombu.connection.Connection.connect'))
+ # TODO(stephenfin): Remove when we drop support for kombo < 4.6.8
+ if hasattr(kombu.connection.Connection, 'connect'):
+ self.useFixture(fixtures.MockPatch(
+ 'kombu.connection.Connection.connect'))
self.addCleanup(self.connection.close)
def test_ensure_four_retry(self):