diff --git a/tests/test_cache.py b/tests/test_cache.py index 846929f..ebdafdc 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -3,7 +3,7 @@ import os.path import subprocess -from renee.src.renee.cache import get_sif_cache_dir, get_singularity_cachedir +from ccbr_tools.pipeline.cache import get_sif_cache_dir, get_singularity_cachedir renee_run = ( "./bin/renee run " diff --git a/tests/test_run.py b/tests/test_run.py index 229d40a..de28a0c 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -3,25 +3,26 @@ import os import tempfile -from renee.src.renee.util import ( +from ccbr_tools.pipeline.util import ( get_tmp_dir, get_shared_resources_dir, renee_base, + get_hpcname, ) -from renee.src.renee.cache import get_sif_cache_dir -from renee.src.renee.run import run, run_in_context -from renee.src.renee.util import get_hpcname +from ccbr_tools.pipeline.cache import get_sif_cache_dir +from ccbr_tools.shell import exec_in_context + +from renee.src.renee.util import renee_base +from renee.src.renee.run import run def test_dryrun(): if get_hpcname() == "biowulf": with tempfile.TemporaryDirectory() as tmp_dir: run_args = argparse.Namespace( - input=list(glob.glob(os.path.join(renee_base(".tests"), "*.fastq.gz"))), + input=list(glob.glob(renee_base(".tests", "*.fastq.gz"))), output=tmp_dir, - genome=os.path.join( - renee_base("config"), "genomes", "biowulf", "hg38_36.json" - ), + genome=renee_base("config", "genomes", "biowulf", "hg38_36.json"), mode="slurm", runmode="run", dry_run=True, @@ -36,7 +37,7 @@ def test_dryrun(): threads=2, ) # execute dry run and capture stdout/stderr - allout = run_in_context(run_args) + allout = exec_in_context(run, run_args) assert ( "This was a dry-run (flag -n). The order of jobs does not reflect the order of execution." in allout diff --git a/tests/test_util.py b/tests/test_util.py index d344e21..4860f50 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -6,13 +6,14 @@ import tempfile import warnings -from renee.src.renee.util import ( - renee_base, +from ccbr_tools.pipeline.util import ( _cp_r_safe_, get_genomes_dict, get_genomes_list, ) +from renee.src.renee.util import renee_base + def test_renee_base(): renee_bin = renee_base(os.path.join("bin", "renee")) @@ -52,7 +53,7 @@ def test_cp_unsafe(): def test_get_genomes_warnings(): with warnings.catch_warnings(record=True) as raised_warnings: - genomes = get_genomes_list(hpcname="notAnOption") + genomes = get_genomes_list(repo_base=renee_base, hpcname="notAnOption") assertions = [ "len(genomes) == 0", "len(raised_warnings) == 2", @@ -68,10 +69,12 @@ def test_get_genomes_warnings(): def test_get_genomes_error(): with pytest.raises(UserWarning) as exception_info: - get_genomes_list(hpcname="notAnOption", error_on_warnings=True) + get_genomes_list( + repo_base=renee_base, hpcname="notAnOption", error_on_warnings=True + ) assert "Folder does not exist" in str(exception_info.value) def test_get_genomes_biowulf(): - genomes_dict = get_genomes_dict(hpcname="biowulf") + genomes_dict = get_genomes_dict(repo_base=renee_base, hpcname="biowulf") assert len(genomes_dict) > 10