fix: show confirmed scope beside actual residual release results
This commit is contained in:
1 parent
651b539d0e
commit
14c9a74bbf
3 files changed
+43
-3
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from cbb_refresh_verify import library_lock
|
||||
from cbb_refresh_verify.ui.residual_release_dialog import ResidualReleaseDialog
|
||||
|
||||
|
||||
def test_confirmed_scope_and_execution_divergence_are_visible(qtbot, tmp_path, monkeypatch):
|
||||
library = tmp_path/'lib.lmc'
|
||||
rows = [dict(name='ExpeditionPCB.exe', pid=pid, project=name, detail='可正常关闭')
|
||||
for pid, name in ((10, 'A'), (20, 'B'))]
|
||||
monkeypatch.setattr(library_lock, 'inspect_residual_sessions',
|
||||
lambda *_: dict(library=str(library), sessions=rows))
|
||||
monkeypatch.setattr(library_lock, 'release_residual_sessions', lambda *a, **kw:
|
||||
dict(status='PARTIAL', sessions=[
|
||||
dict(rows[0], consent_allowed=True, release_status='RELEASED', detail='已退出'),
|
||||
dict(rows[1], consent_allowed=True, release_status='WAITING', detail='原生操作进行中')]))
|
||||
dialog = ResidualReleaseDialog(library, tmp_path/'evidence')
|
||||
qtbot.addWidget(dialog)
|
||||
qtbot.waitUntil(lambda: not dialog.busy)
|
||||
dialog.confirm_button.click()
|
||||
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 '原生操作进行中' in dialog.table.item(1, 3).text()
|
||||
assert '确认允许 2' in dialog.message.text() and '未释放 1' in dialog.message.text()
|
||||
Reference in new issue
Block a user