Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,26 @@ def test_config_set_and_get(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatc
assert "gemini-2.5-pro" in result.stdout

def test_config_invalid_key(self) -> None:
# Test set with invalid key
result = runner.invoke(app, ["config", "set", "invalid-key", "value"])
assert result.exit_code == 1
assert "Unknown config key" in result.stdout

# Test get with invalid key
result = runner.invoke(app, ["config", "get", "invalid-key"])
assert result.exit_code == 1
assert "Unknown config key" in result.stdout

def test_config_get_not_set(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
from gemstack.project.config import GemstackConfig

config_path = tmp_path / "config.toml"
monkeypatch.setattr(GemstackConfig, "config_path", classmethod(lambda cls: config_path))

# default-topology is None by default
result = runner.invoke(app, ["config", "get", "default-topology"])
assert result.exit_code == 0
assert "(not set)" in result.stdout


class TestExportCommand:
Expand Down
Loading