Browse Source

Make tests pass with random python hashseed

Under python3 and latest tox a random python hashseed is used. Currently
oslo.messaging tests do not pass this because one test assumes the
resulting list conversion from a list of lists has a specific order.
Sort both lists so that the order is explicit when checking for equality
in this test. Doing so makes the test pass with a random python hash
seed.

Note I am not actually familiar enough with oslo.messaging to know if
this failure is correct and the drivers or something deeper should be
returning lists with an explicit order. This would be the case if order
in these lists is important.

Change-Id: Id54ca1f448f466304b72b1695a5c646311bbd453
changes/79/114079/2
Clark Boylan 7 years ago
committed by Davanum Srinivas (dims)
parent
commit
220ccb816c
  1. 3
      tests/notify/test_notifier.py

3
tests/notify/test_notifier.py

@ -498,7 +498,8 @@ group_1:
with mock.patch.object(self.router, '_get_drivers_for_message',
drivers_mock):
self.notifier.info({}, 'my_event', {})
self.assertEqual(['rpc', 'foo'], pm.map.call_args[0][6])
self.assertEqual(sorted(['rpc', 'foo']),
sorted(pm.map.call_args[0][6]))
def test_notify_filtered(self):
self.config(routing_notifier_config="routing_notifier.yaml")

Loading…
Cancel
Save