2.5 KiB
2.5 KiB
CC Switch CLI - Test Plan
Test Inventory
| Test File | Tests | Type |
|---|---|---|
test_core.py |
46 | Unit tests with synthetic data |
test_full_e2e.py |
20 | E2E tests against a real or configured CC Switch database |
Unit Test Coverage
Database and Config Helpers
CCSWITCH_HOMEpath resolution- DB, config, and settings path helpers
- SQLite in-memory connection setup
- Config load/save, including empty-file behavior
- Valid app type list
CLI Core Helpers
- App resolution for valid, invalid, and
Noneapp values - Table formatting for normal, empty, and single-row data
- Sensitive-value masking for tokens, API keys, passwords, short secrets, nested dicts, nested lists, authorization headers, and hotkey false positives
CLI Commands
- Top-level help and command group help
- Explicit
status --json providers get --jsonmasking for nestedsettings_config- Plain
providers getmasking for nested list/header values settings get --jsonobject outputsettings get/list/setmasking for sensitive settingssessions list --jsonempty-result outputmcp listandskills listinclude OpenClaw stateusage statsnormalizes nullable token/cost aggregatesproviders set-currentDB update plus live Codex config write
Live Config Write Helpers
- Claude settings JSON env merge
- Codex provider TOML merge preserves unrelated
config.tomlsections plusauth.jsonwrites - Gemini
.envmerge with env key validation and newline escaping - OpenCode provider merge into
~/.config/opencode/opencode.json - Temporary file cleanup after secure writes
E2E Coverage
Providers
- List providers
- JSON output
- App filtering
- Nonexistent provider error
- API key leak prevention
Other Command Groups
- Skills list and repos
- Usage stats and logs
- MCP list
- Settings list
- Proxy status
- Default status overview and JSON overview
Latest Verification
python -m pytest cli_anything\ccswitch\tests -q
.................................................................. [100%]
66 passed in 2.61s
Additional checks:
git diff --check
python -m compileall -q cli_anything
Both checks passed.
Coverage Notes
- Write operations covered by synthetic tests:
providers set-current,settings set, and live config writes for Claude, Codex, Gemini, and OpenCode. - Destructive live-database operations and process-control flows should be validated only in a disposable CC Switch environment.