fix(tests): use --no-interactive for non-interactive onboard tests
Tests for non-interactive onboard mode now explicitly use --no-interactive flag since the default changed to interactive mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@ def test_onboard_fresh_install(mock_paths):
|
|||||||
"""No existing config — should create from scratch."""
|
"""No existing config — should create from scratch."""
|
||||||
config_file, workspace_dir, mock_ws = mock_paths
|
config_file, workspace_dir, mock_ws = mock_paths
|
||||||
|
|
||||||
result = runner.invoke(app, ["onboard"])
|
result = runner.invoke(app, ["onboard", "--no-interactive"])
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "Created config" in result.stdout
|
assert "Created config" in result.stdout
|
||||||
@@ -79,7 +79,7 @@ def test_onboard_existing_config_refresh(mock_paths):
|
|||||||
config_file, workspace_dir, _ = mock_paths
|
config_file, workspace_dir, _ = mock_paths
|
||||||
config_file.write_text('{"existing": true}')
|
config_file.write_text('{"existing": true}')
|
||||||
|
|
||||||
result = runner.invoke(app, ["onboard"], input="n\n")
|
result = runner.invoke(app, ["onboard", "--no-interactive"], input="n\n")
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "Config already exists" in result.stdout
|
assert "Config already exists" in result.stdout
|
||||||
@@ -93,7 +93,7 @@ def test_onboard_existing_config_overwrite(mock_paths):
|
|||||||
config_file, workspace_dir, _ = mock_paths
|
config_file, workspace_dir, _ = mock_paths
|
||||||
config_file.write_text('{"existing": true}')
|
config_file.write_text('{"existing": true}')
|
||||||
|
|
||||||
result = runner.invoke(app, ["onboard"], input="y\n")
|
result = runner.invoke(app, ["onboard", "--no-interactive"], input="y\n")
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "Config already exists" in result.stdout
|
assert "Config already exists" in result.stdout
|
||||||
@@ -107,7 +107,7 @@ def test_onboard_existing_workspace_safe_create(mock_paths):
|
|||||||
workspace_dir.mkdir(parents=True)
|
workspace_dir.mkdir(parents=True)
|
||||||
config_file.write_text("{}")
|
config_file.write_text("{}")
|
||||||
|
|
||||||
result = runner.invoke(app, ["onboard"], input="n\n")
|
result = runner.invoke(app, ["onboard", "--no-interactive"], input="n\n")
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "Created workspace" not in result.stdout
|
assert "Created workspace" not in result.stdout
|
||||||
@@ -141,7 +141,7 @@ def test_onboard_uses_explicit_config_and_workspace_paths(tmp_path, monkeypatch)
|
|||||||
|
|
||||||
result = runner.invoke(
|
result = runner.invoke(
|
||||||
app,
|
app,
|
||||||
["onboard", "--config", str(config_path), "--workspace", str(workspace_path)],
|
["onboard", "--config", str(config_path), "--workspace", str(workspace_path), "--no-interactive"],
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ def test_onboard_refresh_rewrites_legacy_config_template(tmp_path, monkeypatch)
|
|||||||
from typer.testing import CliRunner
|
from typer.testing import CliRunner
|
||||||
from nanobot.cli.commands import app
|
from nanobot.cli.commands import app
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
result = runner.invoke(app, ["onboard"], input="n\n")
|
result = runner.invoke(app, ["onboard", "--no-interactive"], input="n\n")
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "contextWindowTokens" in result.stdout
|
assert "contextWindowTokens" in result.stdout
|
||||||
@@ -127,7 +127,7 @@ def test_onboard_refresh_backfills_missing_channel_fields(tmp_path, monkeypatch)
|
|||||||
from typer.testing import CliRunner
|
from typer.testing import CliRunner
|
||||||
from nanobot.cli.commands import app
|
from nanobot.cli.commands import app
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
result = runner.invoke(app, ["onboard"], input="n\n")
|
result = runner.invoke(app, ["onboard", "--no-interactive"], input="n\n")
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
saved = json.loads(config_path.read_text(encoding="utf-8"))
|
saved = json.loads(config_path.read_text(encoding="utf-8"))
|
||||||
|
|||||||
Reference in New Issue
Block a user