Skip to content

Commit

Permalink
update test of download for gnps1
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Jan 10, 2025
1 parent 4337c87 commit 418ff4c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/unit/metabolomics/test_gnps_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ def test_get_url(gnps_version, task_id, url, tmpdir):
["189e8bf16af145758b0a900f1c44ff4a", GNPSFormat.SNETSV2],
],
)
def test_downloads_file(task_id, workflow, tmpdir, gnps_zip_files):
downloader = GNPSDownloader(task_id, tmpdir)
def test_download_gnps1(task_id, workflow, tmpdir, gnps_zip_files, gnps_website_is_down):
if gnps_website_is_down:
pytest.skip("GNPS website is down: https://gnps.ucsd.edu")
downloader = GNPSDownloader(task_id, tmpdir, gnps_version="1")
downloader.download()
actual = zipfile.ZipFile(downloader.get_download_file())
actual_names = actual.namelist()
expected = zipfile.ZipFile(gnps_zip_files[workflow])
expected_names = [x.filename for x in expected.filelist if x.compress_size > 0]
assert all(item in actual_names for item in expected_names)
expected_names = expected.namelist()
assert actual_names == expected_names

0 comments on commit 418ff4c

Please sign in to comment.