Skip to content
Closed
Changes from 3 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
24 changes: 24 additions & 0 deletions tests/copilot_usage/test_render_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,27 @@ def test_multi_model_shutdown_via_full_render(self) -> None:
row = next(line for line in output.splitlines() if "2025-01-01 01:00" in line)
assert re.search(r"\b7\b", row) # total model calls = 3 + 4
assert re.search(r"\b800\b", row) # total output tokens = 500 + 300


# ---------------------------------------------------------------------------
# Issue #860 — untested branch in _build_event_details
# ---------------------------------------------------------------------------

Comment thread
microsasa marked this conversation as resolved.

class TestBuildEventDetailsUntestedBranches:
"""Cover the remaining _build_event_details branch unique to this module."""

Comment thread
microsasa marked this conversation as resolved.
def test_tool_execution_complete_with_model(self) -> None:
"""TOOL_EXECUTION_COMPLETE with model set must include 'model=...'."""
from copilot_usage.render_detail import _build_event_details

ev = SessionEvent(
type=EventType.TOOL_EXECUTION_COMPLETE,
data={
Comment thread
microsasa marked this conversation as resolved.
"toolCallId": "tc1",
"model": "claude-sonnet-4",
"success": True,
},
)
detail = _build_event_details(ev)
assert "model=claude-sonnet-4" in detail
Comment thread
microsasa marked this conversation as resolved.
Loading