fix: keep prewrite-cancelled CBBs available for fresh admission
This commit is contained in:
1 parent
48f38d1bdd
commit
3b4323405a
3 files changed
+46
-5
No files matched your search
@@ -337,3 +337,37 @@ def test_pcb_open_option_is_bound_only_to_ordinary_verify(qtbot, tmp_path, monke
|
||||
qtbot.waitUntil(lambda: not window.busy)
|
||||
assert len(requests) == 1
|
||||
assert requests[0].auto_confirm_pcb_open is enabled
|
||||
|
||||
|
||||
@pytest.mark.parametrize('prewrite', (True, False))
|
||||
def test_prewrite_cancellation_can_resubmit_and_rechecks_ready(qtbot, tmp_path, monkeypatch, prewrite):
|
||||
calls = []
|
||||
reads = []
|
||||
|
||||
def verify(request):
|
||||
calls.append(request.block_name)
|
||||
window.stop.set()
|
||||
return VerifyResult('CANCELLED', safe_to_continue=False, cancelled_before_write=prewrite)
|
||||
|
||||
def read(names, library):
|
||||
reads.append(names)
|
||||
return {'Beta': 'READY' if len(reads) > 1 else 'PENDING'}
|
||||
|
||||
window = load_window(qtbot, tmp_path, monkeypatch, verifier=verify,
|
||||
status_refresher=lambda *_: pytest.fail('cancelled batch started a status refresh'))
|
||||
window.catalog_reader = object()
|
||||
monkeypatch.setattr(window, '_execution_status_reader', lambda *_: read)
|
||||
window.search_edit.setText('beta')
|
||||
window.batch_button.click()
|
||||
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
|
||||
|
||||
window.batch_button.click()
|
||||
qtbot.waitUntil(lambda: not window.busy)
|
||||
assert reads == [('Beta',), ('Beta',)]
|
||||
assert calls == ['Beta']
|
||||
assert window.cbb_table.item(1, 3).text().startswith('SKIPPED:')
|
||||
Reference in new issue
Block a user