File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,12 +45,11 @@ def ops_file_fixture():
4545 return storage
4646
4747def test_named_objs_helper (ops_file_fixture ):
48- wizard = mock_wizard ([])
4948 helper_func = named_objs_helper (ops_file_fixture , 'foo' )
50- helper_func (wizard , 'any' )
51- assert "what I found" in wizard . console . log_text
52- assert "bar" in wizard . console . log_text
53- assert "baz" in wizard . console . log_text
49+ result = helper_func ('any' )
50+ assert "what I found" in result
51+ assert "bar" in result
52+ assert "baz" in result
5453
5554@pytest .mark .parametrize ('with_failure' , [False , True ])
5655def test_get_ops_storage (tmpdir , with_failure ):
Original file line number Diff line number Diff line change 11from paths_cli .parameters import INPUT_FILE
22from paths_cli .wizard .core import get_object
33from paths_cli .wizard .standard_categories import CATEGORIES
4+ from paths_cli .wizard .helper import Helper
5+ from functools import partial
46
57from paths_cli .wizard .errors import FILE_LOADING_ERROR_MSG
68LABEL = "Load existing from OPS file"
79
810def named_objs_helper (storage , store_name ):
9- def list_items (wizard , user_input ):
11+ def list_items (user_input , context = None ):
1012 store = getattr (storage , store_name )
1113 names = [obj for obj in store if obj .is_named ]
1214 outstr = "\n " .join (['* ' + obj .name for obj in names ])
13- wizard . say ( f"Here's what I found:\n \n { outstr } " )
15+ return f"Here's what I found:\n \n { outstr } "
1416
1517 return list_items
1618
19+
1720@get_object
1821def _get_ops_storage (wizard ):
1922 filename = wizard .ask ("What file can it be found in?" ,
Original file line number Diff line number Diff line change @@ -48,10 +48,12 @@ def __init__(self, steps):
4848 def _patch (self ): # no-cov
4949 import openpathsampling as paths
5050 from openpathsampling .experimental .storage import monkey_patch_all
51+ from paths_cli .param_core import StorageLoader
5152 if not self ._patched :
5253 paths = monkey_patch_all (paths )
5354 paths .InterfaceSet .simstore = True
5455 self ._patched = True
56+ StorageLoader .has_simstore_patch = True
5557
5658 def debug (content ): # no-cov
5759 # debug does no pretty-printing
You can’t perform that action at this time.
0 commit comments