You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
In PR #1749, a new fragment test was added which uncovered an issue with the generated unit test for ads. This is related to #1596. There were certain places in the ads templates that were missed as part of #1596.
# Mock the http request call within the method and fake a response.
with mock.patch.object(type(client.transport._session), 'request') as req:
# Designate an appropriate value for the returned response.
return_value = service_pb2.Service(
name='name_value',
title='title_value',
producer_project_id='producer_project_id_value',
id='id_value',
)
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
> json_return_value = service_pb2.Service.to_json(return_value)
E AttributeError: to_json
/tmp/tmpdvtl_8w9/tests/unit/gapic/fragment/test_service_manager.py:666: AttributeError
__________________ test_create_service_config_rest_flattened ___________________
def test_create_service_config_rest_flattened():
client = ServiceManagerClient(
credentials=ga_credentials.AnonymousCredentials(),
transport="rest",
)
# Mock the http request call within the method and fake a response.
with mock.patch.object(type(client.transport._session), 'request') as req:
# Designate an appropriate value for the returned response.
return_value = service_pb2.Service()
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
> json_return_value = service_pb2.Service.to_json(return_value)
E AttributeError: to_json
/tmp/tmpdvtl_8w9/tests/unit/gapic/fragment/test_service_manager.py:832: AttributeError
The issue is the we're trying to call .to_json() on a protobuf message and .to_json() available for proto-plus messages.
In PR #1749, a new fragment test was added which uncovered an issue with the generated unit test for ads. This is related to #1596. There were certain places in the ads templates that were missed as part of #1596.
See build log here:
https://github.com/googleapis/gapic-generator-python/actions/runs/6026704981/job/16350267511?pr=1749
The issue is the we're trying to call
.to_json()on a protobuf message and.to_json()available for proto-plus messages.