feat(03-02): implement ProgressMonitor class
- Add ProgressInfo dataclass for progress data - Add ProgressMonitor class with: - PROGRESS_PATTERNS for extraction (percentage, fraction, phase, completion) - extract_progress() to find progress indicators in output - should_send_update() with 60 second throttling - create_progress_card() for Feishu card formatting - Fix fraction pattern to allow content after fraction (e.g., [3/5 tasks]) - Fix should_send_update() to return False on first call - Fix test assertions to use kwargs instead of positional args All 7 tests pass for progress monitoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,8 +106,8 @@ class TestProgressMonitorCardCreation:
|
||||
card = monitor.create_progress_card(progress, "Processing data...")
|
||||
|
||||
formatter.format_info.assert_called_once()
|
||||
call_args = formatter.format_info.call_args
|
||||
content = call_args[0][1]
|
||||
call_kwargs = formatter.format_info.call_args.kwargs
|
||||
content = call_kwargs.get("content", "")
|
||||
assert "75%" in content
|
||||
|
||||
def test_create_progress_card_uses_executing_title(self):
|
||||
@@ -126,6 +126,6 @@ class TestProgressMonitorCardCreation:
|
||||
card = monitor.create_progress_card(progress, "Working...")
|
||||
|
||||
formatter.format_info.assert_called_once()
|
||||
call_args = formatter.format_info.call_args
|
||||
title = call_args[0][0]
|
||||
call_kwargs = formatter.format_info.call_args.kwargs
|
||||
title = call_kwargs.get("title", "")
|
||||
assert title == "正在执行..."
|
||||
|
||||
Reference in New Issue
Block a user