Skip to content

Commit

Permalink
fix issues related to mocked sammy binary
Browse files Browse the repository at this point in the history
  • Loading branch information
KedoKudo committed Dec 26, 2024
1 parent 6efd3b2 commit d0fb413
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/unit/pleiades/sammy/backends/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@


@pytest.fixture
def local_config(temp_working_dir):
def mock_sammy_executable(monkeypatch):
"""Mock shutil.which to simulate SAMMY being available."""

def mock_which(cmd):
if cmd == "sammy":
return "sammy"
return None

monkeypatch.setattr("shutil.which", mock_which)
return mock_which


@pytest.fixture
def local_config(temp_working_dir, mock_sammy_executable):
"""Create local SAMMY configuration."""
_ = mock_sammy_executable # make pre-commit happy
local_sammy_config = LocalSammyConfig(
working_dir=temp_working_dir,
output_dir=temp_working_dir / "output",
Expand Down

0 comments on commit d0fb413

Please sign in to comment.