Skip to content

Commit

Permalink
TST: Remove ordering from test pass criteria for Manifest.download
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Mar 21, 2024
1 parent 0eb1dfe commit 811cc94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/resources/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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`."""
Expand All @@ -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,
Expand Down

0 comments on commit 811cc94

Please sign in to comment.