29 lines
745 B
Python
29 lines
745 B
Python
"""Tests for teammate spawn helper behavior."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
from openharness.swarm.spawn_utils import (
|
|
TEAMMATE_COMMAND_ENV_VAR,
|
|
build_inherited_env_vars,
|
|
get_teammate_command,
|
|
)
|
|
|
|
|
|
def test_get_teammate_command_prefers_current_interpreter(monkeypatch):
|
|
monkeypatch.delenv(TEAMMATE_COMMAND_ENV_VAR, raising=False)
|
|
monkeypatch.setattr(sys, "executable", "/tmp/current-python")
|
|
|
|
command = get_teammate_command()
|
|
|
|
assert command == "/tmp/current-python"
|
|
|
|
|
|
def test_build_inherited_env_vars_disables_coordinator_mode(monkeypatch):
|
|
monkeypatch.setenv("CLAUDE_CODE_COORDINATOR_MODE", "1")
|
|
|
|
env = build_inherited_env_vars()
|
|
|
|
assert env["CLAUDE_CODE_COORDINATOR_MODE"] == "0"
|