comparison env/lib/python3.9/site-packages/cwltool/tests/test_dependencies.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 import os
2 from distutils import spawn
3
4 import pytest
5
6 from cwltool.utils import onWindows
7
8 from .util import get_data, get_main_output, needs_docker
9
10 try:
11 from galaxy.tools import deps # type: ignore
12 except ImportError:
13 deps = None
14
15
16 @needs_docker
17 @pytest.mark.skipif(not deps, reason="galaxy-lib is not installed")
18 def test_biocontainers() -> None:
19 wflow = get_data("tests/seqtk_seq.cwl")
20 job = get_data("tests/seqtk_seq_job.json")
21 error_code, _, _ = get_main_output(["--beta-use-biocontainers", wflow, job])
22
23 assert error_code == 0
24
25
26 @pytest.mark.skipif(onWindows(), reason="bioconda currently not working on MS Windows")
27 @pytest.mark.skipif(not deps, reason="galaxy-lib is not installed")
28 def test_bioconda() -> None:
29 wflow = get_data("tests/seqtk_seq.cwl")
30 job = get_data("tests/seqtk_seq_job.json")
31 error_code, _, stderr = get_main_output(
32 ["--beta-conda-dependencies", "--debug", wflow, job]
33 )
34
35 assert error_code == 0, stderr
36
37
38 @pytest.mark.skipif(
39 not spawn.find_executable("modulecmd"), reason="modulecmd not installed"
40 )
41 def test_modules() -> None:
42 wflow = get_data("tests/random_lines.cwl")
43 job = get_data("tests/random_lines_job.json")
44 os.environ["MODULEPATH"] = os.path.join(
45 os.getcwd(), "tests/test_deps_env/modulefiles"
46 )
47 error_code, _, stderr = get_main_output(
48 [
49 "--beta-dependency-resolvers-configuration",
50 "tests/test_deps_env_modules_resolvers_conf.yml",
51 "--debug",
52 wflow,
53 job,
54 ]
55 )
56
57 assert error_code == 0, stderr