fix: allow same-window retry after early PCB cancellation

This commit is contained in:
阿白叔 committed 2026-11-25 10:02:11 +08:00
1 parent 806c1696ab
commit 6aed02d26b
4 files changed
+84 -12

No files matched your search

+20
View File
@@ -364,3 +364,23 @@ def test_batch_summary_exposes_failures_only_report(qtbot, tmp_path):
window._batch_done(([VerifyResult('FAIL',stderr='Mentor error')],report))
assert '仅失败日志' in window.summary.detailedText()
assert str(report.with_name('failures-20260929-test.log')) in window.summary.detailedText()
def test_cancelled_pending_item_can_be_submitted_for_fresh_admission(qtbot, tmp_path):
records = (CbbRecord('Pending', 'LP', status='PENDING'), CbbRecord('Unconfirmed', 'LP'))
window = MainWindow(reader=lambda _: LibraryReadResult(records), data_root=tmp_path)
qtbot.addWidget(window)
window.lmc_edit.setText('lib.lmc')
window.load_library()
qtbot.waitUntil(lambda: not window.busy)
window.catalog_reader = object()
window._batch_requests = (window._request('Pending'), window._request('Unconfirmed'))
window._batch_refreshed(([VerifyResult('CANCELLED', safe_to_continue=False),
VerifyResult('FAIL', safe_to_continue=False)], None,
['Pending', 'Unconfirmed'], None))
assert window._records_by_name['Pending'].status == 'UNKNOWN'
assert window._eligible_names(require_status=True) == ['Pending']
assert window.batch_button.isEnabled()
window._apply_refreshed_records((('Pending',), {'Pending': 'READY'}, {}, ''))
assert window._eligible_names(require_status=True) == []