This commit is contained in:
@@ -520,6 +520,7 @@ def test_ppt_audit_run_vision_queues_background_audit(client, monkeypatch):
|
||||
|
||||
def test_ppt_audit_trigger_aider_heal_accepts_issue_summary(client, monkeypatch):
|
||||
"""視覺 QA failed 常只有 issues_found;AiderHeal 應可吃診斷摘要派工。"""
|
||||
from routes import admin_observability_routes as mod
|
||||
from services import aider_heal_executor as svc
|
||||
|
||||
captured = {}
|
||||
@@ -536,6 +537,15 @@ def test_ppt_audit_trigger_aider_heal_accepts_issue_summary(client, monkeypatch)
|
||||
|
||||
monkeypatch.setattr(svc, 'execute_code_fix', fake_execute_code_fix)
|
||||
|
||||
class ImmediateThread:
|
||||
def __init__(self, target, **_kwargs):
|
||||
self.target = target
|
||||
|
||||
def start(self):
|
||||
self.target()
|
||||
|
||||
monkeypatch.setattr(mod.threading, 'Thread', ImmediateThread)
|
||||
|
||||
r = client.post(
|
||||
'/observability/ppt_audit/trigger_aider_heal',
|
||||
json={
|
||||
@@ -545,8 +555,9 @@ def test_ppt_audit_trigger_aider_heal_accepts_issue_summary(client, monkeypatch)
|
||||
)
|
||||
data = r.get_json()
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.status_code == 202
|
||||
assert data['ok'] is True
|
||||
assert data['status'] == 'queued'
|
||||
assert captured['error_type'] == 'ppt_vision_audit_failure'
|
||||
assert captured['target_file'] == 'services/ppt_generator.py'
|
||||
assert 'ocbot_daily_20260517.pptx' in captured['error_message']
|
||||
|
||||
Reference in New Issue
Block a user