Skip to content

Commit

Permalink
migrate test
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Nov 6, 2024
1 parent 7361a3c commit c423a4d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
38 changes: 38 additions & 0 deletions tests/unit/snakemake_invoke/invoke/test_invoke_subprocess.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import pytest
import sys
from pathlib import Path
from snakemake_invoke.config import SnakemakeInvokeConfig
from snakemake_invoke.invoke.invoke_subprocess import InvokeSubprocess


@pytest.fixture()
def config_snakefile_path() -> Path:
return Path("/tmp/workflow/Snakefile")


@pytest.fixture
def config(config_snakefile_path):
return SnakemakeInvokeConfig(snakefile_path=config_snakefile_path)


@pytest.fixture
def invoke(config):
return InvokeSubprocess(config=config)


@pytest.mark.parametrize(
"input_args,expected",
[
Expand All @@ -16,3 +34,23 @@
def test_args_to_shell_command(input_args, expected):
result = InvokeSubprocess._args_to_shell_command(input_args)
assert result == expected


def test_get_base_command(invoke) -> None:
base_command = invoke.get_base_command(
extra_args=["--keep-going"],
work_dir=Path("/tmp/work"),
)
assert base_command == [
sys.executable,
"-m",
"snakemake",
"-d",
"/tmp/work",
"--cores",
"1",
"--snakefile",
"/tmp/workflow/Snakefile",
"--rerun-incomplete",
"--keep-going",
]
Empty file removed tests/unit/workflow/__init__.py
Empty file.
39 changes: 0 additions & 39 deletions tests/unit/workflow/test_snakemake_invoke.py

This file was deleted.

0 comments on commit c423a4d

Please sign in to comment.