def test_validate_auto_config_file_e2e(data, is_valid, tmpdir): service = "foo" conf_file = "marathon-norcal-devc" tmpdir.mkdir(service) filepath = config_utils.write_auto_config_data( service=service, extra_info=conf_file, data=data, soa_dir=tmpdir, ) assert config_utils.validate_auto_config_file(filepath) == is_valid
def test_validate_auto_config_file_config_types(mock_validate, tmpdir): for config_type in config_utils.KNOWN_CONFIG_TYPES: filepath = f"service/{config_type}-cluster.yaml" config_utils.validate_auto_config_file(filepath) mock_validate.assert_called_with(filepath, f"autotuned_defaults/{config_type}")
def test_validate_auto_config_file_unknown_type(mock_validate, tmpdir): assert not config_utils.validate_auto_config_file( "service/unknown-thing.yaml")