mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-02 10:52:22 +00:00
Adapt isolated removal preview tests to verified configuration reader
This commit is contained in:
@@ -5,6 +5,7 @@ import json
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import runpy
|
import runpy
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from types import ModuleType, SimpleNamespace
|
from types import ModuleType, SimpleNamespace
|
||||||
@@ -52,7 +53,8 @@ class InventoryMessages(unittest.TestCase):
|
|||||||
state = ModuleType('oci_installation_state')
|
state = ModuleType('oci_installation_state')
|
||||||
state.parse_config = lambda raw: dict(line.split(': ', 1) for line in raw.decode().splitlines())
|
state.parse_config = lambda raw: dict(line.split(': ', 1) for line in raw.decode().splitlines())
|
||||||
scope = {'sys': SimpleNamespace(path=[]), 'source_text': lambda text: text or '',
|
scope = {'sys': SimpleNamespace(path=[]), 'source_text': lambda text: text or '',
|
||||||
'translate': translate, 're': re}
|
'translate': translate, 're': re, 'subprocess': subprocess,
|
||||||
|
'_selected_configuration': remover.guest_config}
|
||||||
summary = extracted(MENU, '_removal_summary', scope)
|
summary = extracted(MENU, '_removal_summary', scope)
|
||||||
with patch.dict(sys.modules, {'oci_instances': instances, 'oci_remove': remover,
|
with patch.dict(sys.modules, {'oci_instances': instances, 'oci_remove': remover,
|
||||||
'oci_installation_state': state}):
|
'oci_installation_state': state}):
|
||||||
|
|||||||
Reference in New Issue
Block a user