Skip to content

Commit

Permalink
Added test form non-yaml-files
Browse files Browse the repository at this point in the history
  • Loading branch information
lamsoa729 committed Jan 17, 2024
1 parent d62c80f commit 24eefc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/mhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def setup_and_teardown(clean_up):

@pytest.fixture()
def mock_args_file(mock_root_dir, clean_up):
args_file_path = mock_root_dir / 'args.yaml'
args_file_path = mock_root_dir / 'mock_args.yaml'
with args_file_path.open('w') as aff:
yaml.dump(MOCK_ARGS_FILE_DICT, aff)
yield args_file_path
Expand Down
14 changes: 3 additions & 11 deletions tests/test_chi_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_chi_node_dir_creation(mock_chi_node):


def test_chi_node_subnode_creation(mock_root_dir, mock_args_file, mock_create_opts):
"""!Test to make sure subnodes are generated properly.
"""!Test to make sure subnodes are generated properly for basic usage.
"""
root_path = mock_root_dir
mock_args_path = mock_args_file
Expand All @@ -68,7 +68,8 @@ def test_chi_node_subnode_creation(mock_root_dir, mock_args_file, mock_create_op
assert (pa_dir_path / 'mock_param.yaml').exists()
assert (yaml.safe_load(
(pa_dir_path / 'mock_param_chi_param.yaml').open('r'))['var_param'] == pa)
assert (pa_dir_path / 'args.yaml').exists()
assert (pa_dir_path / 'mock_args.yaml').exists()
assert (pa_dir_path / 'mock_ny_file.txt').exists()


def test_chi_node_multilevel_subnode_creation(mock_yaml_dict, mock_create_opts):
Expand Down Expand Up @@ -218,12 +219,3 @@ def test_chi_node_matched_creation_runtime_error(mock_yaml_dict, mock_create_opt
cnode.make_node_dir(root_path)
with pytest.raises(RuntimeError):
cnode.make_subnodes()


def test_chi_node_nonyaml_create(mock_root_dir, mock_create_opts):
"""!Test to make sure subnodes are generated properly.
"""
root_path = mock_root_dir
mock_create_opts.param_files = list(root_path.glob('*.yaml'))
# TODO NEXT TEST Make sure nonyaml files are created
pass

0 comments on commit 24eefc2

Please sign in to comment.