Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cblakkan committed Dec 28, 2024
1 parent 6e25e32 commit 4200699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions yamale/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def _validate_dir(root, schema_name, cpus, parser, strict):
def _router(paths, schema_name, cpus, parser, strict=True):
for path in paths:
path = os.path.abspath(path)
if os.path.isfile(path):
_validate_single(path, schema_name, parser, strict)
else:
if os.path.isdir(path):
_validate_dir(path, schema_name, cpus, parser, strict)
else:
_validate_single(path, schema_name, parser, strict)


def main():
Expand Down
5 changes: 2 additions & 3 deletions yamale/tests/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ def test_multiple_paths_good_yaml():
def test_multiple_paths_bad_yaml():
with pytest.raises(ValueError) as e:
command_line._router([
"yamale/tests/command_line_fixtures/yamls/good.yaml",
"yamale/tests/command_line_fixtures/yamls/bad.yaml",
"yamale/tests/command_line_fixtures/yamls/required_keys_bad.yaml",
], "schema.yaml", 1, "PyYAML")
assert "map.bad: '12.5' is not a str." in e.value.message
assert "map.key: Required field missing" in e.value.message
assert "map.bad: '12.5' is not a int." in e.value.message


@pytest.mark.parametrize("parser", parsers)
Expand Down

0 comments on commit 4200699

Please sign in to comment.