Newer
Older

Malte Nyhuis
committed
from pathlib import Path
import snakemake
from py._path.local import LocalPath as TmpDir
def test_snakefile(tmpdir: TmpDir) -> None:
"""
this test is working, but its not suitable for long-term-development
it copies (deploys) the workflow into TmpDir and it is executing a snakemake dry-run
"""
# Create input files
import os

Malte Nyhuis
committed
from ntrfc.utils.snake_utils.deployment import deploy

Malte Nyhuis
committed

Malte Nyhuis
committed
workdir: Path = Path(tmpdir)

Malte Nyhuis
committed
# Get the path to the snakefile

Malte Nyhuis
committed
# Run Snakemake
result: bool = snakemake.snakemake(
snakefile=str(os.path.join(tmpdir, "Snakefile")),

Malte Nyhuis
committed
resources={"mem_gb": 8},
workdir=str(workdir),

Malte Nyhuis
committed
dryrun=True,
quiet=False,
verbose=True,
# log_handler=[logger.log_handler],

Malte Nyhuis
committed
ignore_ambiguity=True,
)
# Check the results
assert result, "Snakemake did not complete successfully"