From bef76170cbdd80abea4dff94a4db1a719f2c3c7e Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Fri, 25 Sep 2015 15:07:01 +0200 Subject: [PATCH] Don't rely on dict ordering in test_plugins_standard Change-Id: I63b5b2d9dfafe237a9d9111f231adb42c2b231d3 --- ironic_inspector/test/test_plugins_standard.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ironic_inspector/test/test_plugins_standard.py b/ironic_inspector/test/test_plugins_standard.py index c4c3f3256..f14f35427 100644 --- a/ironic_inspector/test/test_plugins_standard.py +++ b/ironic_inspector/test/test_plugins_standard.py @@ -183,8 +183,9 @@ class TestValidateInterfacesHook(test_base.NodeTest): self.hook.before_processing(self.data) self.assertEqual(self.active_interfaces, self.data['interfaces']) - self.assertEqual([i['mac'] for i in self.active_interfaces.values()], - self.data['macs']) + self.assertEqual(sorted(i['mac'] for i in + self.active_interfaces.values()), + sorted(self.data['macs'])) self.assertEqual(self.orig_interfaces, self.data['all_interfaces']) def test_only_active(self): @@ -192,8 +193,9 @@ class TestValidateInterfacesHook(test_base.NodeTest): self.hook.before_processing(self.data) self.assertEqual(self.active_interfaces, self.data['interfaces']) - self.assertEqual([i['mac'] for i in self.active_interfaces.values()], - self.data['macs']) + self.assertEqual(sorted(i['mac'] for i in + self.active_interfaces.values()), + sorted(self.data['macs'])) self.assertEqual(self.orig_interfaces, self.data['all_interfaces']) def test_all(self): @@ -201,8 +203,9 @@ class TestValidateInterfacesHook(test_base.NodeTest): self.hook.before_processing(self.data) self.assertEqual(self.orig_interfaces, self.data['interfaces']) - self.assertEqual([i['mac'] for i in self.orig_interfaces.values()], - self.data['macs']) + self.assertEqual(sorted(i['mac'] for i in + self.orig_interfaces.values()), + sorted(self.data['macs'])) self.assertEqual(self.orig_interfaces, self.data['all_interfaces']) @mock.patch.object(node_cache.NodeInfo, 'delete_port', autospec=True)