17 lines
532 B
Python
17 lines
532 B
Python
from app.task_event_bridge import TaskEventBridge
|
|
from app.task_statistics import TaskStatistics
|
|
|
|
|
|
def test_task_event_bridge_creates_events():
|
|
event = TaskEventBridge().task_created({"task_id": "t1", "title": "demo"})
|
|
assert event["kind"] == "task_created"
|
|
|
|
|
|
def test_task_statistics_counts():
|
|
result = TaskStatistics().summarize([
|
|
{"status": "completed", "elapsed_seconds": 10},
|
|
{"status": "blocked", "blocker": "approval"},
|
|
])
|
|
assert result["completed"] == 1
|
|
assert result["blocked"] == 1
|