test: verify release wording and cancelled item resubmission
This commit is contained in:
1 parent
6a716052f4
commit
2e87627ef1
5 files changed
+11
-9
No files matched your search
@@ -2017,8 +2017,11 @@ class MainWindow(QWidget):
|
|||||||
if status not in STATUS_LABELS:
|
if status not in STATUS_LABELS:
|
||||||
status = 'UNKNOWN'
|
status = 'UNKNOWN'
|
||||||
record = self._records_by_name[name]
|
record = self._records_by_name[name]
|
||||||
source = ('cancelled_verify' if name in cancelled_retries else
|
source = record.status_source
|
||||||
'unknown' if status == 'UNKNOWN' else 'authoritative')
|
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._records_by_name[name] = replace(record, status=status, status_source=source)
|
||||||
self.ready_names.discard(name)
|
self.ready_names.discard(name)
|
||||||
if reasons is not None:
|
if reasons is not None:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ def test_aggregate_completed_release_checks_keep_final_proof_visible(release_wor
|
|||||||
dialog.confirm_button.click()
|
dialog.confirm_button.click()
|
||||||
qtbot.waitUntil(lambda: not dialog.busy, timeout=5000)
|
qtbot.waitUntil(lambda: not dialog.busy, timeout=5000)
|
||||||
assert len(proofs) == 1, dialog.message.text()
|
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]
|
proof = proofs[0]
|
||||||
else:
|
else:
|
||||||
context = operation_queue.BatchTaskContext(str(library))
|
context = operation_queue.BatchTaskContext(str(library))
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ def test_confirmed_scope_and_execution_divergence_are_visible(qtbot, tmp_path, m
|
|||||||
qtbot.waitUntil(lambda: not dialog.busy)
|
qtbot.waitUntil(lambda: not dialog.busy)
|
||||||
assert dialog.table.columnCount() == 8
|
assert dialog.table.columnCount() == 8
|
||||||
assert dialog.table.item(0, 6).text() == dialog.table.item(1, 6).text() == '允许'
|
assert dialog.table.item(0, 6).text() == dialog.table.item(1, 6).text() == '允许'
|
||||||
assert dialog.table.item(0, 7).text() == '已释放'
|
assert dialog.table.item(0, 7).text() == '客户端已退出'
|
||||||
assert dialog.table.item(1, 7).text() == '未释放'
|
assert dialog.table.item(1, 7).text() == '未退出'
|
||||||
assert '原生操作进行中' in dialog.table.item(1, 3).text()
|
assert '原生操作进行中' in dialog.table.item(1, 3).text()
|
||||||
assert '确认允许 2' in dialog.message.text() and '未释放 1' in dialog.message.text()
|
assert '确认允许 2' in dialog.message.text() and '未释放 1' in dialog.message.text()
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ owned private desktop/PID, a resolved resource command and an exact PRJ.
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import ast
|
import ast
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ def test_no_input_injection_or_desktop_switching_in_production_code():
|
|||||||
# interactive compatibility mode; the default worker remains
|
# interactive compatibility mode; the default worker remains
|
||||||
# isolated and never reaches this branch.
|
# isolated and never reaches this branch.
|
||||||
continue
|
continue
|
||||||
if api in text:
|
if re.search(r'\b' + re.escape(api) + r'\b', text):
|
||||||
offenders.append(f'{path.name}: {api}')
|
offenders.append(f'{path.name}: {api}')
|
||||||
assert offenders == [], f'输入注入/桌面切换/菜单驱动 API 不得出现在生产代码: {offenders}'
|
assert offenders == [], f'输入注入/桌面切换/菜单驱动 API 不得出现在生产代码: {offenders}'
|
||||||
|
|
||||||
|
|||||||
@@ -362,9 +362,7 @@ def test_prewrite_cancellation_can_resubmit_and_rechecks_ready(qtbot, tmp_path,
|
|||||||
qtbot.waitUntil(lambda: not window.busy)
|
qtbot.waitUntil(lambda: not window.busy)
|
||||||
assert calls == ['Beta']
|
assert calls == ['Beta']
|
||||||
assert window.visible_records()[0].status == ('PENDING' if prewrite else 'UNKNOWN')
|
assert window.visible_records()[0].status == ('PENDING' if prewrite else 'UNKNOWN')
|
||||||
assert window.batch_button.isEnabled() == prewrite
|
assert window.batch_button.isEnabled()
|
||||||
if not prewrite:
|
|
||||||
return
|
|
||||||
|
|
||||||
window.batch_button.click()
|
window.batch_button.click()
|
||||||
qtbot.waitUntil(lambda: not window.busy)
|
qtbot.waitUntil(lambda: not window.busy)
|
||||||
|
|||||||
Reference in new issue
Block a user