Something went wrong. Try again.
MCP based ACP agent
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839"""CLI --fork / --fork-idx flag validation (typer layer, no agent spawn).
The full fork flow is gated by the E2E tier; here we only pin down theargument contract: both flags need -s/--session, and they exclude each other."""
import pytestfrom rich.console import Consolefrom typer.testing import CliRunner
from crow_cli.cli import main as cli_mainfrom crow_cli.cli.main import app
runner = CliRunner()
@pytest.fixture(autouse=True)def wide_console(monkeypatch): # Keep rich from wrapping the error lines so assertions stay simple. monkeypatch.setattr(cli_main.client, "_console", Console(width=200))
def test_fork_requires_session(): result = runner.invoke(app, ["run", "--fork", "hello"]) assert result.exit_code == 1 assert "require -s/--session" in result.output
def test_fork_idx_requires_session(): result = runner.invoke(app, ["run", "--fork-idx", "2", "hello"]) assert result.exit_code == 1 assert "require -s/--session" in result.output
def test_fork_and_fork_idx_mutually_exclusive(): result = runner.invoke(app, ["run", "-s", "abc", "--fork", "--fork-idx", "2", "hello"]) assert result.exit_code == 1 assert "mutually exclusive" in result.output