Skip to content

Commit

Permalink
Add more debugging output when checking expected files
Browse files Browse the repository at this point in the history
  • Loading branch information
amstilp committed Sep 25, 2024
1 parent 615a0dd commit a5f9f6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ def _check_prefetch_against_manifest(self, directory, manifest):
"""Check that prefetch downloaded all the files in the manifest."""
expected_files = self._read_manifest(manifest)
downloaded_files = os.listdir(directory)
print("Found downloaded files:")
print(sorted(downloaded_files))
print("Expected {} files; found {} files.", len(expected_files), len(downloaded_files))
return set(downloaded_files) == set(expected_files)

def _check_prefetch_against_n_files(self, directory, n_files):
"""Check that prefetch downloaded the expected number of files."""
downloaded_files = os.listdir(directory)
print(downloaded_files)
print("Found downloaded files:")
print(sorted(downloaded_files))
print("Expected {} files; found {} files.", n_files, len(downloaded_files))
return len(downloaded_files) == n_files

def _untar(self, directory):
Expand Down

0 comments on commit a5f9f6f

Please sign in to comment.