Skip to content

Commit 4139e5c

Browse files
authored
Update test_tui.py
1 parent afb3fd2 commit 4139e5c

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎tests/test_tui.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,32 @@ def test_dump_single_round_no_separator(self):
622622
self.assertIn("only round", out)
623623
self.assertNotIn("round 2", out)
624624

625+
def test_dump_reports_time_spent(self):
626+
"""After the last response, the total time spent on the run is
627+
reported, mirroring the per-tool elapsed on tool results."""
628+
import time as _time
629+
630+
tui, buf = make_tui()
631+
tui.session.last_messages = [
632+
Message(role="user", content="question"),
633+
Message(role="assistant", content="answer"),
634+
]
635+
tui._run_start = _time.time() - 6.8
636+
tui._dump_conversation()
637+
out = buf.getvalue()
638+
self.assertIn("✓ time spent (6.8s):", out)
639+
640+
def test_dump_no_time_spent_when_unrecorded(self):
641+
"""No run start recorded (e.g. restored session) → no indicator."""
642+
tui, buf = make_tui()
643+
tui.session.last_messages = [
644+
Message(role="user", content="question"),
645+
Message(role="assistant", content="answer"),
646+
]
647+
tui._dump_conversation()
648+
out = buf.getvalue()
649+
self.assertNotIn("time spent", out)
650+
625651
def test_live_panel_shows_only_current_round(self):
626652
"""The live panel renders only the LATEST round (messages from
627653
round_start on), so a second request does not replay the first

0 commit comments

Comments
 (0)