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)
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)
def test_configure(): cli = Cli() config = cli.load_config('tests/files/validate_failing_aws.yml') with pytest.raises(InvalidConfigurationError): cli.configure(config=config)
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')