mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-04 20:02:07 +00:00
Isolate catalog worker in offline Slovak menu regression
This commit is contained in:
@@ -12,7 +12,7 @@ from unittest.mock import Mock, patch
|
||||
|
||||
ROOT=Path(__file__).resolve().parents[3]
|
||||
sys.path[:0]=[str(ROOT/'oci/src'),str(ROOT/'oci/remote')]
|
||||
from proxmenux_oci import cli, custom, custom_mounts, extra_devices, i18n, installer, ui as native_ui, updates
|
||||
from proxmenux_oci import catalog_refresh, cli, custom, custom_mounts, extra_devices, i18n, installer, ui as native_ui, updates
|
||||
from proxmenux_oci.catalog import Catalog
|
||||
|
||||
|
||||
@@ -203,7 +203,13 @@ class InputAndCancellationTests(StorageFixture):
|
||||
def test_real_menu_error_handler_has_slovak_heading_and_preserves_detail(self):
|
||||
ui=Mock();ui.choose.side_effect=['custom',None]
|
||||
with patch.object(cli,'interactive_ui',return_value=ui),patch.object(custom,'explore',side_effect=ValueError('fiction-detail')), \
|
||||
patch.object(updates,'UpdateCheck') as checker:
|
||||
patch.object(updates,'UpdateCheck') as checker, \
|
||||
patch.object(catalog_refresh,'CatalogRefresh') as catalog_checker:
|
||||
# Keep this wording/error-handler test offline and free of writes.
|
||||
# The real background worker has its own catalog lifecycle tests.
|
||||
catalog_check=catalog_checker.return_value.__enter__.return_value
|
||||
catalog_check.active=False;catalog_check.consume.return_value=False
|
||||
catalog_check.describe.return_value=''
|
||||
check=checker.return_value.__enter__.return_value
|
||||
check.active=False;check.notice.return_value='';check.status.return_value={'available':[]}
|
||||
self.assertEqual(cli.interactive(self.catalog),0)
|
||||
|
||||
Reference in New Issue
Block a user