Skip to content

## Test coverage: cli

Test coverage: cli.py command dispatch

Add tests for CLI command dispatch in src/projio/cli.py.

What to test

  • main() with init subcommand: verify scaffold is called with correct args.
  • main() with sync subcommand: verify sync_workspace is called.
  • main() with config show subcommand: verify output.
  • main() with no args: verify help/error.
  • main() with set-python subcommand: verify set_python is called.

Where

  • Source: src/projio/cli.py
  • Tests: add to tests/test_cli.py

Approach

Use monkeypatch to mock downstream functions (scaffold, sync_workspace, etc.) and verify they're called with expected args. Use capsys for output capture. Existing test_cli.py has parser tests — add dispatch tests alongside.

Batch Result

  • status: done
  • batch queue_id: fa9ae36ce1aa
  • session: bf8a344f-5f23-4791-ab7b-17a624a7fc7f
  • batch duration: 441.8s