Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagowfx committed Jul 1, 2024
1 parent 40ecdef commit ef7b585
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions yamale/tests/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def scoped_change_dir(new_dir):
def test_bad_yaml(parser):
with pytest.raises(ValueError) as e:
command_line._router(
"yamale/tests/command_line_fixtures/yamls/bad.yaml",
["yamale/tests/command_line_fixtures/yamls/bad.yaml"],
"schema.yaml",
1,
parser,
Expand All @@ -37,7 +37,7 @@ def test_bad_yaml(parser):
def test_required_keys_yaml(parser):
with pytest.raises(ValueError) as e:
command_line._router(
"yamale/tests/command_line_fixtures/yamls/required_keys_bad.yaml",
["yamale/tests/command_line_fixtures/yamls/required_keys_bad.yaml"],
"required_keys_schema.yaml",
1,
parser,
Expand All @@ -47,13 +47,13 @@ def test_required_keys_yaml(parser):

@pytest.mark.parametrize("parser", parsers)
def test_good_yaml(parser):
command_line._router("yamale/tests/command_line_fixtures/yamls/good.yaml", "schema.yaml", 1, parser)
command_line._router(["yamale/tests/command_line_fixtures/yamls/good.yaml"], "schema.yaml", 1, parser)


@pytest.mark.parametrize("parser", parsers)
def test_good_relative_yaml(parser):
command_line._router(
"yamale/tests/command_line_fixtures/yamls/good.yaml",
["yamale/tests/command_line_fixtures/yamls/good.yaml"],
"../schema_dir/external.yaml",
1,
parser,
Expand All @@ -63,13 +63,13 @@ def test_good_relative_yaml(parser):
@pytest.mark.parametrize("parser", parsers)
def test_good_relative_schema_in_subfolder(parser):
with scoped_change_dir("yamale/tests/command_line_fixtures/schema_dir"):
command_line._router("../yamls/good.yaml", "external.yaml", 1, parser)
command_line._router(["../yamls/good.yaml"], "external.yaml", 1, parser)


@pytest.mark.parametrize("parser", parsers)
def test_external_glob_schema(parser):
command_line._router(
"yamale/tests/command_line_fixtures/yamls/good.yaml",
["yamale/tests/command_line_fixtures/yamls/good.yaml"],
os.path.join(dir_path, "command_line_fixtures/schema_dir/ex*.yaml"),
1,
parser,
Expand All @@ -79,7 +79,7 @@ def test_external_glob_schema(parser):
def test_empty_schema_file():
with pytest.raises(ValueError, match="is an empty file!"):
command_line._router(
"yamale/tests/command_line_fixtures/empty_schema/data.yaml",
["yamale/tests/command_line_fixtures/empty_schema/data.yaml"],
"empty_schema.yaml",
1,
"PyYAML",
Expand All @@ -88,7 +88,7 @@ def test_empty_schema_file():

def test_external_schema():
command_line._router(
"yamale/tests/command_line_fixtures/yamls/good.yaml",
["yamale/tests/command_line_fixtures/yamls/good.yaml"],
os.path.join(dir_path, "command_line_fixtures/schema_dir/external.yaml"),
1,
"PyYAML",
Expand All @@ -103,7 +103,7 @@ def test_bad_dir():
def test_bad_strict():
with pytest.raises(ValueError) as e:
command_line._router(
"yamale/tests/command_line_fixtures/yamls/required_keys_extra_element.yaml",
["yamale/tests/command_line_fixtures/yamls/required_keys_extra_element.yaml"],
"required_keys_schema.yaml",
4,
"PyYAML",
Expand Down

0 comments on commit ef7b585

Please sign in to comment.