From 220ccb816c75fe72f32a3112dae0b3c0790645fe Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Wed, 13 Aug 2014 16:21:23 -0700
Subject: [PATCH] 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
---
 tests/notify/test_notifier.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/notify/test_notifier.py b/tests/notify/test_notifier.py
index 3c0442cc9..9fda8062c 100644
--- a/tests/notify/test_notifier.py
+++ b/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")