Ejemplo n.º 1
0
def test_invalid_file_missing_properties_cli(capsys):
    assert main([get_error_example_path('step-missing-required-properties.yaml')]) == 1
    out, err = capsys.readouterr()
    assert "step-missing-required-properties.yaml" in out
    assert "'command' is a required property" in out
    assert "'name' is a required property" in out
    assert "8 is not valid under any of the given schemas" in out
Ejemplo n.º 2
0
def test_invalid_file_cli(capsys):
    assert main([bad_example_path]) == 1
    out, err = capsys.readouterr()
    assert "invalid.yaml" in out
    assert "'command' is a required property" in out
    assert "'name' is a required property" in out
    assert "8 is not valid under any of the given schemas" in out
Ejemplo n.º 3
0
def test_invalid_file_too_long_input_name_cli(capsys):
    assert main([get_error_example_path('input-name-too-long.yaml')]) == 1
    out, err = capsys.readouterr()
    assert "input-name-too-long.yaml" in out
    assert "'this-input-name-is-way-too-long-and-will-cause-the-validation-to-fail' is too long" in out
Ejemplo n.º 4
0
def test_warning_examples_cli(capsys, yaml_path):
    "Test that warning examples don't validate via the CLI in strict mode."
    assert main(['--strict-warnings', yaml_path]) == 1
    out, err = capsys.readouterr()
    assert out
Ejemplo n.º 5
0
def test_bad_examples_cli(capsys, bad_example_path):
    "Test that bad examples don't validate via the CLI."
    assert main([bad_example_path]) == 1
    out, err = capsys.readouterr()
    assert out
Ejemplo n.º 6
0
def test_good_examples_cli(good_example_path):
    "Test that known-good files validate via the CLI."
    assert main([good_example_path]) == 0
Ejemplo n.º 7
0
def test_valid_file_cli(path):
    "Test that known-good files validate via the CLI."
    assert main([path]) == 0