コード例 #1
0
def test_validate_config():
    cli = Cli()
    passing_config = cli.load_config('tests/files/validate_passing.yml')
    failing_configs = list()
    failing_configs.append(cli.load_config('tests/files/validate_failing_aws.yml'))
    failing_configs.append(cli.load_config('tests/files/validate_failing_hosts.yml'))
    failing_configs.append(cli.load_config('tests/files/validate_failing_host.yml'))
    failing_configs.append(cli.load_config('tests/files/validate_failing_logging.yml'))
    failing_configs.append(cli.load_config('tests/files/validate_failing_output.yml'))
    failing_configs.append(cli.load_config('tests/files/validate_failing_root.yml'))

    cli.validate_config(passing_config)

    with pytest.raises(InvalidConfigurationError):
        for conf in failing_configs:
            cli.validate_config(conf)
コード例 #2
0
def test_validate_config():
    cli = Cli()
    passing_config = cli.load_config('tests/files/validate_passing.yml')
    failing_configs = list()
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_aws.yml'))
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_hosts.yml'))
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_host.yml'))
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_logging.yml'))
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_output.yml'))
    failing_configs.append(
        cli.load_config('tests/files/validate_failing_root.yml'))

    cli.validate_config(passing_config)

    with pytest.raises(InvalidConfigurationError):
        for conf in failing_configs:
            cli.validate_config(conf)
コード例 #3
0
def test_configure():
    cli = Cli()
    config = cli.load_config('tests/files/validate_failing_aws.yml')
    with pytest.raises(InvalidConfigurationError):
        cli.configure(config=config)
コード例 #4
0
def test_load_config():
    cli = Cli()
    config = cli.load_config('tests/files/yml_passing.yml')

    with pytest.raises(YAMLError):
        config = cli.load_config('tests/files/yml_failing.yml')
コード例 #5
0
def test_configure():
    cli = Cli()
    config = cli.load_config('tests/files/validate_failing_aws.yml')
    with pytest.raises(InvalidConfigurationError):
        cli.configure(config=config)
コード例 #6
0
def test_load_config():
    cli = Cli()
    config = cli.load_config('tests/files/yml_passing.yml')

    with pytest.raises(YAMLError):
        config = cli.load_config('tests/files/yml_failing.yml')