Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update gapic-generator-python to gracefully handle internal google inconsistencies #721

Merged
merged 3 commits into from
Jan 5, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ def test_{{ service.name|snake_case }}_host_with_port():


def test_{{ service.name|snake_case }}_grpc_transport_channel():
channel = grpc.insecure_channel('http://localhost/')
channel = grpc.secure_channel('http://localhost/', grpc.local_channel_credentials())

# Check that channel is used if provided.
transport = transports.{{ service.name }}GrpcTransport(
Expand All @@ -1199,7 +1199,7 @@ def test_{{ service.name|snake_case }}_grpc_transport_channel():


def test_{{ service.name|snake_case }}_grpc_asyncio_transport_channel():
channel = aio.insecure_channel('http://localhost/')
channel = aio.secure_channel('http://localhost/', grpc.local_channel_credentials())

# Check that channel is used if provided.
transport = transports.{{ service.name }}GrpcAsyncIOTransport(
Expand All @@ -1216,7 +1216,7 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
transport_class
):
with mock.patch("grpc.ssl_channel_credentials", autospec=True) as grpc_ssl_channel_cred:
with mock.patch.object(transport_class, "create_channel", autospec=True) as grpc_create_channel:
with mock.patch.object(transport_class, "create_channel") as grpc_create_channel:
mock_ssl_cred = mock.Mock()
grpc_ssl_channel_cred.return_value = mock_ssl_cred

Expand Down Expand Up @@ -1267,7 +1267,7 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_adc(
__init__=mock.Mock(return_value=None),
ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred),
):
with mock.patch.object(transport_class, "create_channel", autospec=True) as grpc_create_channel:
with mock.patch.object(transport_class, "create_channel") as grpc_create_channel:
mock_grpc_channel = mock.Mock()
grpc_create_channel.return_value = mock_grpc_channel
mock_cred = mock.Mock()
Expand Down