def test_fetch_google_api_spec_error(self, monkeypatch, converter):
    """Test error handling when fetching Google API specification."""
    # Create a mock that raises an error
    mock_build = MagicMock(
        side_effect=HttpError(resp=MagicMock(status=404), content=b"Not Found")
    )
    monkeypatch.setattr(
        "google.adk.tools.google_api_tool.googleapi_to_openapi_converter.build",
        mock_build,
    )

    # Verify exception is raised
    with pytest.raises(HttpError):
      converter.fetch_google_api_spec()
Test error handling when fetching Google API specification.
tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py