From 773a24e602dab6bd42b0ffe7180fefebc8384586 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 18 Jul 2018 09:44:51 -0700 Subject: [PATCH 1/2] Make accepting a custom transport actually work. --- .../resources/com/google/api/codegen/py/main.snip | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/resources/com/google/api/codegen/py/main.snip b/src/main/resources/com/google/api/codegen/py/main.snip index 61514e84a5..0260ce51fe 100644 --- a/src/main/resources/com/google/api/codegen/py/main.snip +++ b/src/main/resources/com/google/api/codegen/py/main.snip @@ -126,11 +126,12 @@ 'credentials; these are mutually exclusive.' ) self.transport = transport - self.transport = {@api.grpcTransportImportName}.{@api.grpcTransportClassName}( - address=self.SERVICE_ADDRESS, - channel=channel, - credentials=credentials, - ) + else: + self.transport = {@api.grpcTransportImportName}.{@api.grpcTransportClassName}( + address=self.SERVICE_ADDRESS, + channel=channel, + credentials=credentials, + ) # Client information initialization. if client_info is None: From ebc587a0925ed2db50d5da2f89be2a5541a74373 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 18 Jul 2018 09:46:40 -0700 Subject: [PATCH 2/2] Fix change detector tests. --- .../testdata/py/python_library.baseline | 11 +++++----- .../py/python_multiple_services.baseline | 22 ++++++++++--------- .../py/python_no_path_templates.baseline | 11 +++++----- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline index 78d1036d16..05593c02d9 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline @@ -1184,11 +1184,12 @@ class LibraryServiceClient(object): 'credentials; these are mutually exclusive.' ) self.transport = transport - self.transport = library_service_grpc_transport.LibraryServiceGrpcTransport( - address=self.SERVICE_ADDRESS, - channel=channel, - credentials=credentials, - ) + else: + self.transport = library_service_grpc_transport.LibraryServiceGrpcTransport( + address=self.SERVICE_ADDRESS, + channel=channel, + credentials=credentials, + ) if client_info is None: client_info = ( diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline index a0c625c255..0ddb9c57a6 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline @@ -937,11 +937,12 @@ class DecrementerServiceClient(object): 'credentials; these are mutually exclusive.' ) self.transport = transport - self.transport = decrementer_service_grpc_transport.DecrementerServiceGrpcTransport( - address=self.SERVICE_ADDRESS, - channel=channel, - credentials=credentials, - ) + else: + self.transport = decrementer_service_grpc_transport.DecrementerServiceGrpcTransport( + address=self.SERVICE_ADDRESS, + channel=channel, + credentials=credentials, + ) if client_info is None: client_info = ( @@ -1149,11 +1150,12 @@ class IncrementerServiceClient(object): 'credentials; these are mutually exclusive.' ) self.transport = transport - self.transport = incrementer_service_grpc_transport.IncrementerServiceGrpcTransport( - address=self.SERVICE_ADDRESS, - channel=channel, - credentials=credentials, - ) + else: + self.transport = incrementer_service_grpc_transport.IncrementerServiceGrpcTransport( + address=self.SERVICE_ADDRESS, + channel=channel, + credentials=credentials, + ) if client_info is None: client_info = ( diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline index edd43d1569..999ba23b94 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline @@ -886,11 +886,12 @@ class NoTemplatesAPIServiceClient(object): 'credentials; these are mutually exclusive.' ) self.transport = transport - self.transport = no_templates_api_service_grpc_transport.NoTemplatesApiServiceGrpcTransport( - address=self.SERVICE_ADDRESS, - channel=channel, - credentials=credentials, - ) + else: + self.transport = no_templates_api_service_grpc_transport.NoTemplatesApiServiceGrpcTransport( + address=self.SERVICE_ADDRESS, + channel=channel, + credentials=credentials, + ) if client_info is None: client_info = (