summaryrefslogtreecommitdiff
path: root/oslo_messaging/tests/drivers/test_impl_rabbit.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_messaging/tests/drivers/test_impl_rabbit.py')
-rw-r--r--oslo_messaging/tests/drivers/test_impl_rabbit.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py
index 8955661..34c396b 100644
--- a/oslo_messaging/tests/drivers/test_impl_rabbit.py
+++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py
@@ -1008,21 +1008,36 @@ class RpcKombuHATestCase(test_utils.BaseTestCase):
self.assertRaises(oslo_messaging.MessageDeliveryFailure,
self.connection.ensure, mock_callback,
retry=4)
- self.assertEqual(6, mock_callback.call_count)
+ # TODO(stephenfin): Remove when we drop support for kombu < 5.2.4
+ expected = 5
+ if kombu.VERSION < (5, 2, 4):
+ expected = 6
+ self.assertEqual(expected, mock_callback.call_count)
def test_ensure_one_retry(self):
mock_callback = mock.Mock(side_effect=IOError)
self.assertRaises(oslo_messaging.MessageDeliveryFailure,
self.connection.ensure, mock_callback,
retry=1)
- self.assertEqual(3, mock_callback.call_count)
+ # TODO(stephenfin): Remove when we drop support for kombu < 5.2.4
+ expected = 2
+ if kombu.VERSION < (5, 2, 4):
+ expected = 3
+ self.assertEqual(expected, mock_callback.call_count)
def test_ensure_no_retry(self):
mock_callback = mock.Mock(side_effect=IOError)
- self.assertRaises(oslo_messaging.MessageDeliveryFailure,
- self.connection.ensure, mock_callback,
- retry=0)
- self.assertEqual(2, mock_callback.call_count)
+ self.assertRaises(
+ oslo_messaging.MessageDeliveryFailure,
+ self.connection.ensure,
+ mock_callback,
+ retry=0,
+ )
+ # TODO(stephenfin): Remove when we drop support for kombu < 5.2.4
+ expected = 1
+ if kombu.VERSION < (5, 2, 4):
+ expected = 2
+ self.assertEqual(expected, mock_callback.call_count)
class ConnectionLockTestCase(test_utils.BaseTestCase):