Skip to content

Commit

Permalink
Add a test for the wrapper around singularity_pull_image() in get_sin…
Browse files Browse the repository at this point in the history
…gularity_images()
  • Loading branch information
MatthiasZepper committed Jun 22, 2023
1 parent 82df716 commit 6e836c3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,30 @@ def test_singularity_pull_image_singularity_installed(self, tmp_dir, mock_rich_p
def test_singularity_pull_image_successfully(self, tmp_dir, mock_rich_progress):
download_obj = DownloadWorkflow(pipeline="dummy", outdir=tmp_dir)
download_obj.singularity_pull_image(
"hello-world", f"{tmp_dir}/helloworld.sif", None, "docker.io", mock_rich_progress
"hello-world", f"{tmp_dir}/yet-another-hello-world.sif", None, "docker.io", mock_rich_progress
)

#
# Tests for 'get_singularity_images'
#
@pytest.mark.skipif(
shutil.which("singularity") is None,
reason="Can't test what Singularity does if it's not installed.",
)
@with_temporary_folder
@mock.patch("nf_core.utils.fetch_wf_config")
def test_get_singularity_images(self, tmp_path, mock_fetch_wf_config):
download_obj = DownloadWorkflow(pipeline="dummy", outdir=tmp_path, container_library=["quay.io", "docker.io"])
mock_fetch_wf_config.return_value = {
"process.mapping.container": "helloworld",
"process.mapping.container": "helloooooooworld",
}
download_obj.find_container_images("workflow")
download_obj.get_singularity_images()
import pdb

pdb.set_trace()

# If Singularity is not installed, it raises a OSError because the singularity command can't be found.
@pytest.mark.skipif(
shutil.which("singularity") is not None,
Expand Down

0 comments on commit 6e836c3

Please sign in to comment.