def METHOD_NAME(api_http_header_env_var, tmp_path, yaml_document, expected_api_http_headers, expected_error):
    yaml_file_path = tmp_path / "api_http_headers.yaml"
    yaml_file_path.write_text(yaml_document)
    if expected_error is None:
        file_based_headers = api_http_headers.deserialize_file_based_headers(yaml_file_path)
        assert file_based_headers == expected_api_http_headers
    else:
        with pytest.raises(expected_error):
            api_http_headers.deserialize_file_based_headers(yaml_file_path)