diff --git a/src/cbb_refresh_verify/ui/main_window.py b/src/cbb_refresh_verify/ui/main_window.py index a863783..515c67d 100644 --- a/src/cbb_refresh_verify/ui/main_window.py +++ b/src/cbb_refresh_verify/ui/main_window.py @@ -2017,8 +2017,11 @@ class MainWindow(QWidget): if status not in STATUS_LABELS: status = 'UNKNOWN' record = self._records_by_name[name] - source = ('cancelled_verify' if name in cancelled_retries else - 'unknown' if status == 'UNKNOWN' else 'authoritative') + source = record.status_source + if name in cancelled_retries: + source = 'cancelled_verify' + elif source == 'cancelled_verify': + source = 'unknown' if status == 'UNKNOWN' else 'authoritative' self._records_by_name[name] = replace(record, status=status, status_source=source) self.ready_names.discard(name) if reasons is not None: diff --git a/tests/test_release_progress.py b/tests/test_release_progress.py index 714bdbc..fb424e8 100644 --- a/tests/test_release_progress.py +++ b/tests/test_release_progress.py @@ -68,7 +68,7 @@ def test_aggregate_completed_release_checks_keep_final_proof_visible(release_wor dialog.confirm_button.click() qtbot.waitUntil(lambda: not dialog.busy, timeout=5000) assert len(proofs) == 1, dialog.message.text() - assert '已释放 0 个会话' in dialog.message.text() + assert '库已释放' in dialog.message.text() and '0 个客户端退出' in dialog.message.text() proof = proofs[0] else: context = operation_queue.BatchTaskContext(str(library)) diff --git a/tests/test_review348_release_comparison.py b/tests/test_review348_release_comparison.py index f9093d5..643c722 100644 --- a/tests/test_review348_release_comparison.py +++ b/tests/test_review348_release_comparison.py @@ -19,8 +19,8 @@ def test_confirmed_scope_and_execution_divergence_are_visible(qtbot, tmp_path, m qtbot.waitUntil(lambda: not dialog.busy) assert dialog.table.columnCount() == 8 assert dialog.table.item(0, 6).text() == dialog.table.item(1, 6).text() == '允许' - assert dialog.table.item(0, 7).text() == '已释放' - assert dialog.table.item(1, 7).text() == '未释放' + assert dialog.table.item(0, 7).text() == '客户端已退出' + assert dialog.table.item(1, 7).text() == '未退出' assert '原生操作进行中' in dialog.table.item(1, 3).text() assert '确认允许 2' in dialog.message.text() and '未释放 1' in dialog.message.text() diff --git a/tests/test_safety.py b/tests/test_safety.py index dffbed4..c908251 100644 --- a/tests/test_safety.py +++ b/tests/test_safety.py @@ -9,6 +9,7 @@ owned private desktop/PID, a resolved resource command and an exact PRJ. from pathlib import Path import ast import json +import re import pytest @@ -57,7 +58,7 @@ def test_no_input_injection_or_desktop_switching_in_production_code(): # interactive compatibility mode; the default worker remains # isolated and never reaches this branch. continue - if api in text: + if re.search(r'\b' + re.escape(api) + r'\b', text): offenders.append(f'{path.name}: {api}') assert offenders == [], f'输入注入/桌面切换/菜单驱动 API 不得出现在生产代码: {offenders}' diff --git a/tests/test_ui_filters.py b/tests/test_ui_filters.py index 0047e86..0d1dc16 100644 --- a/tests/test_ui_filters.py +++ b/tests/test_ui_filters.py @@ -362,9 +362,7 @@ def test_prewrite_cancellation_can_resubmit_and_rechecks_ready(qtbot, tmp_path, qtbot.waitUntil(lambda: not window.busy) assert calls == ['Beta'] assert window.visible_records()[0].status == ('PENDING' if prewrite else 'UNKNOWN') - assert window.batch_button.isEnabled() == prewrite - if not prewrite: - return + assert window.batch_button.isEnabled() window.batch_button.click() qtbot.waitUntil(lambda: not window.busy)