This commit is contained in:
@@ -201,20 +201,36 @@ def test_ppt_audit_history_shows_ppt_schedule_and_db_runs(client, monkeypatch):
|
||||
'cadences': cadences,
|
||||
'cadence_summary': '、'.join(c['schedule_text'] for c in cadences),
|
||||
})
|
||||
monkeypatch.setattr(svc, 'get_generation_run_history', lambda **_kw: [{
|
||||
'schedule_kind': 'daily',
|
||||
'schedule_label': '每日',
|
||||
'report_type': 'daily',
|
||||
'report_label': '每日日報',
|
||||
'target_label': '2026/05/17',
|
||||
'status': 'ready',
|
||||
'status_label': '已產生',
|
||||
'file_name': 'ocbot_daily_20260517.pptx',
|
||||
'file_size_kb': 1024,
|
||||
'error_msg': '',
|
||||
'started_at': '2026-05-17 20:30',
|
||||
'finished_at': '2026-05-17 20:31',
|
||||
}])
|
||||
monkeypatch.setattr(svc, 'get_generation_run_history', lambda **_kw: [
|
||||
{
|
||||
'schedule_kind': 'daily',
|
||||
'schedule_label': '每日',
|
||||
'report_type': 'daily',
|
||||
'report_label': '每日日報',
|
||||
'target_label': '2026/05/17',
|
||||
'status': 'error',
|
||||
'status_label': '失敗',
|
||||
'file_name': '',
|
||||
'file_size_kb': None,
|
||||
'error_msg': '產線錯誤:缺少資料來源',
|
||||
'started_at': '2026-05-17 20:29',
|
||||
'finished_at': '2026-05-17 20:30',
|
||||
},
|
||||
{
|
||||
'schedule_kind': 'daily',
|
||||
'schedule_label': '每日',
|
||||
'report_type': 'daily',
|
||||
'report_label': '每日日報',
|
||||
'target_label': '2026/05/17',
|
||||
'status': 'ready',
|
||||
'status_label': '已產生',
|
||||
'file_name': 'ocbot_daily_20260517.pptx',
|
||||
'file_size_kb': 1024,
|
||||
'error_msg': '',
|
||||
'started_at': '2026-05-17 20:30',
|
||||
'finished_at': '2026-05-17 20:31',
|
||||
},
|
||||
])
|
||||
|
||||
r = client.get('/observability/ppt_audit_history')
|
||||
html = r.data.decode('utf-8')
|
||||
@@ -229,6 +245,8 @@ def test_ppt_audit_history_shows_ppt_schedule_and_db_runs(client, monkeypatch):
|
||||
assert '線上預覽' in html
|
||||
assert 'Action Queue' in html
|
||||
assert '接下來要處理的事' in html
|
||||
assert '異常優先' in html
|
||||
assert '產線錯誤:缺少資料來源' in html
|
||||
assert '待排程補齊' in html
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user