From 811cc9458554fa21cac3af9d7f4b0ec730798d96 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 21 Mar 2024 14:25:43 +0000 Subject: [PATCH] TST: Remove ordering from test pass criteria for `Manifest.download` --- tests/resources/test_manifest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/resources/test_manifest.py b/tests/resources/test_manifest.py index c59a2e823..00ce48fd9 100644 --- a/tests/resources/test_manifest.py +++ b/tests/resources/test_manifest.py @@ -313,7 +313,7 @@ def test_download_without_paths(self): """Test downloading a manifest without specifying the `paths` argument.""" manifest = Manifest(datasets={"my_dataset": self.create_nested_cloud_dataset()}) paths = manifest.download() - self.assertEqual(os.listdir(paths["my_dataset"]), ["file_1.txt", "file_0.txt", "sub-directory"]) + self.assertEqual(set(os.listdir(paths["my_dataset"])), {"file_1.txt", "file_0.txt", "sub-directory"}) def test_download_with_paths(self): """Test downloading a manifest while specifying the `paths` argument.""" @@ -329,11 +329,11 @@ def test_download_with_paths(self): # Check that dataset1 has been downloaded to the given directory. self.assertEqual(paths["dataset1"], temporary_directory) - self.assertEqual(os.listdir(paths["dataset1"]), ["file_1.txt", "file_0.txt", "sub-directory"]) + self.assertEqual(set(os.listdir(paths["dataset1"])), {"file_1.txt", "file_0.txt", "sub-directory"}) # Check that dataset2 has been downloaded to a temporary directory. self.assertNotEqual(paths["dataset2"], temporary_directory) - self.assertEqual(os.listdir(paths["dataset2"]), ["file_1.txt", "file_0.txt", "sub-directory"]) + self.assertEqual(set(os.listdir(paths["dataset2"])), {"file_1.txt", "file_0.txt", "sub-directory"}) def test_download_some_datasets_with_paths(self): """Test downloading a manifest while specifying the `paths` argument and setting `download_all=False`.""" @@ -350,7 +350,7 @@ def test_download_some_datasets_with_paths(self): # Check that dataset1 has been downloaded to the given directory and dataset2 hasn't been downloaded. self.assertEqual(paths, {"dataset1": temporary_directory}) - self.assertEqual(os.listdir(paths["dataset1"]), ["file_1.txt", "file_0.txt", "sub-directory"]) + self.assertEqual(set(os.listdir(paths["dataset1"])), {"file_1.txt", "file_0.txt", "sub-directory"}) self.assertEqual( logging_context.records[1].message,