Skip to content
Closed
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
35 changes: 35 additions & 0 deletions tests/copilot_usage/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,41 @@ def test_group_path_propagates_to_live(tmp_path: Path) -> None:
assert result.exit_code == 0


def test_summary_group_path_propagation(tmp_path: Path) -> None:
"""summary reads --path from group level when not provided at subcommand level."""
_write_session(tmp_path, "grp10000-0000-0000-0000-000000000000", name="GroupPath")
runner = CliRunner()
# --path before subcommand name → stored in ctx.obj, not subcommand
result = runner.invoke(main, ["--path", str(tmp_path), "summary"])
Comment on lines +751 to +756
Comment on lines +751 to +756
assert result.exit_code == 0
assert "GroupPath" in result.output
Comment on lines +751 to +758
Comment on lines +751 to +758


def test_cost_group_path_propagation(tmp_path: Path) -> None:
_write_session(tmp_path, "grp20000-0000-0000-0000-000000000000", name="CostGroup")
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "cost"])
assert result.exit_code == 0


Comment on lines +766 to +767
def test_live_group_path_propagation(tmp_path: Path) -> None:
_write_session(
tmp_path, "grp30000-0000-0000-0000-000000000000", name="LiveGroup", active=True
)
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "live"])
assert result.exit_code == 0

Comment on lines +768 to +775

def test_session_group_path_propagation(tmp_path: Path) -> None:
sid = "grp40000-0000-0000-0000-000000000000"
_write_session(tmp_path, sid, name="SessGroup")
runner = CliRunner()
# session needs the session_id positional argument
result = runner.invoke(main, ["--path", str(tmp_path), "session", sid[:8]])
assert result.exit_code == 0
Comment on lines +761 to +783


Comment on lines +751 to +785
# 5. Auto-refresh branches in _interactive_loop -------------------------------


Expand Down
Loading