From e36e538f819b4991291a24455ece844180497c50 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 2 Nov 2011 09:15:44 +0100 Subject: [PATCH] sort lists before testing for equality Signed-off-by: Steven Armstrong --- lib/cdist/test/explorer/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cdist/test/explorer/__init__.py b/lib/cdist/test/explorer/__init__.py index 1f7a2e35..cafe34fc 100644 --- a/lib/cdist/test/explorer/__init__.py +++ b/lib/cdist/test/explorer/__init__.py @@ -69,7 +69,7 @@ class ExplorerClassTestCase(test.CdistTestCase): self.explorer.transfer_global_explorers() source = self.local.global_explorer_path destination = self.remote.global_explorer_path - self.assertEqual(os.listdir(source), os.listdir(destination)) + self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination))) def test_run_global_explorer(self): self.explorer.transfer_global_explorers() @@ -79,7 +79,7 @@ class ExplorerClassTestCase(test.CdistTestCase): def test_run_global_explorers(self): out_path = self.mkdtemp() self.explorer.run_global_explorers(out_path) - self.assertEqual(os.listdir(out_path), ['foobar', 'global']) + self.assertEqual(sorted(os.listdir(out_path)), sorted(['foobar', 'global'])) shutil.rmtree(out_path) def test_list_type_explorer_names(self): @@ -116,7 +116,7 @@ class ExplorerClassTestCase(test.CdistTestCase): self.explorer.transfer_object_parameters(cdist_object) source = os.path.join(self.local.object_path, cdist_object.parameter_path) destination = os.path.join(self.remote.object_path, cdist_object.parameter_path) - self.assertEqual(os.listdir(source), os.listdir(destination)) + self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination))) def test_run_type_explorer(self): cdist_type = core.Type(self.local.type_path, '__test_type')