Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove filename parser test over filesystem #1586

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions jwql/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,35 +430,6 @@ def test_filename_parser(filename, solution):
assert filename_parser(filename) == solution


@pytest.mark.skipif(ON_GITHUB_ACTIONS, reason='Requires access to central storage.')
def test_filename_parser_whole_filesystem():
"""Test the filename_parser on all files currently in the filesystem."""
# Get all files
filesystem_dir = get_config()['filesystem']
all_files = []
for dir_name, _, file_list in os.walk(filesystem_dir):
for file in file_list:
if 'public' in file or 'proprietary' in file:
if file.endswith('.fits'):
all_files.append(os.path.join(dir_name, file))

# Run the filename_parser on all files
bad_filenames = []
for filepath in all_files:
try:
filename_parser(filepath)
except ValueError:
bad_filenames.append(os.path.basename(filepath))

# Determine if the test failed
fail = bad_filenames != []
failure_msg = '{} files could not be successfully parsed: \n - {}'.\
format(len(bad_filenames), '\n - '.join(bad_filenames))

# Check which ones failed
assert not fail, failure_msg


def test_filename_parser_non_jwst():
"""Attempt to generate a file parameter dictionary from a file
that is not formatted in the JWST naming convention. Ensure the
Expand Down
Loading