mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-08 22:46:41 +00:00
test(oci): give the extracted menu functions the recovery helpers
The menu registers restored containers and refreshes the carried record before it lists or manages an instance. The tests that run those menu functions in isolation provide the new helpers they call.
This commit is contained in:
@@ -41,6 +41,8 @@ class SelectionSetupWording(TestCase):
|
||||
fn = extracted('_interactive_management', os=SimpleNamespace(geteuid=lambda: 0),
|
||||
shutil=SimpleNamespace(which=lambda _: '/fake/pct'), saved_inventory=lambda _: [],
|
||||
_clean_orphans=lambda project: None,
|
||||
recover_automatically=lambda project: None, offer_recovery=lambda project, ui: None,
|
||||
carry_records=lambda project, **options: {},
|
||||
translate=lambda s: s)
|
||||
fn(Path('/fixture'), ui)
|
||||
ui.message.assert_called_once_with(EMPTY, 'OCI management')
|
||||
|
||||
@@ -130,6 +130,7 @@ class UpdateWording(unittest.TestCase):
|
||||
scope = {'sys': SimpleNamespace(path=[], executable='python3'),
|
||||
'translate': lambda text: text, 'check_selected': lambda project, row: row,
|
||||
'images': SimpleNamespace(offer_removal=lambda *args: None),
|
||||
'carry_records': lambda project, **options: {},
|
||||
'_run_lifecycle': lambda command, title: events.append(('run', command, title)) or True}
|
||||
row = {'vmid': 101, 'reason': 'matched', 'stack': False, 'pending': False, 'status': 'installed'}
|
||||
decision = False
|
||||
|
||||
Reference in New Issue
Block a user