From 46bf5cfdf7c0c77c7812db913b23347e6bece884 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 1 Sep 2024 15:01:32 +0000 Subject: [PATCH 01/23] chore: refactor empty_call_test --- .../gapic/%name_%version/%sub/test_macros.j2 | 49 +- .../unit/gapic/asset_v1/test_asset_service.py | 460 +++++++------ .../credentials_v1/test_iam_credentials.py | 80 ++- .../unit/gapic/eventarc_v1/test_eventarc.py | 360 +++++----- .../logging_v2/test_config_service_v2.py | 640 ++++++++++-------- .../logging_v2/test_logging_service_v2.py | 100 +-- .../logging_v2/test_metrics_service_v2.py | 100 +-- .../unit/gapic/redis_v1/test_cloud_redis.py | 220 +++--- 8 files changed, 1110 insertions(+), 899 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index b73e8eac81..04a16f5116 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -123,7 +123,9 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): {% if not method.client_streaming %} -{{ empty_call_test(method, method_name, service, api, uuid4_re)}} +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +{{ method_call_test("empty_call", method, method_name, service, api, uuid4_re, request=None)}} def test_{{ method_name }}_non_empty_request_with_auto_populated_field(): @@ -219,7 +221,9 @@ def test_{{ method_name }}_use_cached_wrapped_rpc(): {% if not full_extended_lro %} {% if not method.client_streaming %} -{{ empty_call_test(method, method_name, service, api, uuid4_re, is_async=True) }} +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +{{ method_call_test("empty_call", method, method_name, service, api, uuid4_re, request=None, is_async=True) }} {% endif %} @pytest.mark.asyncio @@ -1808,26 +1812,23 @@ def test_{{ method_name }}_rest_no_http_options(): {% endmacro %} -{% macro empty_call_test(method, method_name, service, api, uuid4_re, is_async=False) %} +{% macro method_call_test(test_name, method, method_name, service, api, uuid4_re, request, is_async=False) %} +{% set await_prefix = "await " if is_async else "" %} +{% set async_method_prefix = "async " if is_async else "" %} +{% set async_method_suffix = "_async" if is_async else "" %} {% if is_async %} @pytest.mark.asyncio -async def test_{{ method_name }}_empty_call_async(): -{% else %} -def test_{{ method_name }}_empty_call(): -{% endif %}{# if is_async #} - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - {% if is_async %} +{% endif %}{# is_async #} +{{ async_method_prefix }}def test_{{ method_name }}_{{ test_name }}{{ async_method_suffix }}(): +{% if is_async %} client = {{ service.async_client_name }}( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) - {% else %} +{% else %} client = {{ service.client_name }}( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) - {% endif %}{# if is_async #} +{% endif %}{# is_async #} # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1857,11 +1858,21 @@ def test_{{ method_name }}_empty_call(): {% endfor %} )) {% endif %}{# method.void #} - await client.{{ method_name }}() + await client.{{ method_name }}(request={{ request }}) {% else %}{# if not is_async #} - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.{{ method_name }}() + {% if method.void %} + call.return_value = None + {% elif method.lro %} + call.return_value = operations_pb2.Operation(name='operations/op') + {% elif method.server_streaming %} + call.return_value = iter([{{ method.output.ident }}()]) + {% else %} + call.return_value = {{ method.output.ident }}() + {% endif %} + client.{{ method_name }}(request={{ request }}) {% endif %}{# is_async #} + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] {% with method_settings = api.all_method_settings.get(method.meta.address.proto) %} @@ -1874,7 +1885,11 @@ def test_{{ method_name }}_empty_call(): {% endfor %}{# for auto_populated_field in method_settings.auto_populated_fields #} {% endif %}{# if method_settings is not none #} {% endwith %}{# method_settings #} + {% if request %} + assert args[0] == {{ request }} + {% else %} assert args[0] == {{ method.input.ident }}() + {% endif %}{# request #} {% endmacro %} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index f952581a0e..e9f8adbb30 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -815,20 +815,21 @@ def test_export_assets(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_export_assets_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.export_assets), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.export_assets() + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ExportAssetsRequest() @@ -898,13 +899,12 @@ def test_export_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_export_assets_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -915,7 +915,9 @@ async def test_export_assets_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.export_assets() + await client.export_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ExportAssetsRequest() @@ -1094,20 +1096,21 @@ def test_list_assets(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_assets_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_assets), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_assets() + call.return_value = asset_service.ListAssetsResponse() + client.list_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListAssetsRequest() @@ -1174,13 +1177,12 @@ def test_list_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_assets_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1191,7 +1193,9 @@ async def test_list_assets_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListAssetsResponse( next_page_token='next_page_token_value', )) - await client.list_assets() + await client.list_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListAssetsRequest() @@ -1642,20 +1646,21 @@ def test_batch_get_assets_history(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.BatchGetAssetsHistoryResponse) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_batch_get_assets_history_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.batch_get_assets_history), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.batch_get_assets_history() + call.return_value = asset_service.BatchGetAssetsHistoryResponse() + client.batch_get_assets_history(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.BatchGetAssetsHistoryRequest() @@ -1720,13 +1725,12 @@ def test_batch_get_assets_history_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_batch_get_assets_history_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1736,7 +1740,9 @@ async def test_batch_get_assets_history_empty_call_async(): # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetAssetsHistoryResponse( )) - await client.batch_get_assets_history() + await client.batch_get_assets_history(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.BatchGetAssetsHistoryRequest() @@ -1917,20 +1923,21 @@ def test_create_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_feed_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_feed), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_feed() + call.return_value = asset_service.Feed() + client.create_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.CreateFeedRequest() @@ -1997,13 +2004,12 @@ def test_create_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_feed_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2018,7 +2024,9 @@ async def test_create_feed_empty_call_async(): content_type=asset_service.ContentType.RESOURCE, relationship_types=['relationship_types_value'], )) - await client.create_feed() + await client.create_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.CreateFeedRequest() @@ -2291,20 +2299,21 @@ def test_get_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_feed_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_feed), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_feed() + call.return_value = asset_service.Feed() + client.get_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.GetFeedRequest() @@ -2369,13 +2378,12 @@ def test_get_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_feed_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2390,7 +2398,9 @@ async def test_get_feed_empty_call_async(): content_type=asset_service.ContentType.RESOURCE, relationship_types=['relationship_types_value'], )) - await client.get_feed() + await client.get_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.GetFeedRequest() @@ -2653,20 +2663,21 @@ def test_list_feeds(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.ListFeedsResponse) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_feeds_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_feeds), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_feeds() + call.return_value = asset_service.ListFeedsResponse() + client.list_feeds(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListFeedsRequest() @@ -2731,13 +2742,12 @@ def test_list_feeds_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_feeds_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2747,7 +2757,9 @@ async def test_list_feeds_empty_call_async(): # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListFeedsResponse( )) - await client.list_feeds() + await client.list_feeds(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListFeedsRequest() @@ -3010,20 +3022,21 @@ def test_update_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_feed_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_feed), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_feed() + call.return_value = asset_service.Feed() + client.update_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.UpdateFeedRequest() @@ -3086,13 +3099,12 @@ def test_update_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_feed_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3107,7 +3119,9 @@ async def test_update_feed_empty_call_async(): content_type=asset_service.ContentType.RESOURCE, relationship_types=['relationship_types_value'], )) - await client.update_feed() + await client.update_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.UpdateFeedRequest() @@ -3369,20 +3383,21 @@ def test_delete_feed(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_feed_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_feed), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_feed() + call.return_value = None + client.delete_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.DeleteFeedRequest() @@ -3447,13 +3462,12 @@ def test_delete_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_feed_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3462,7 +3476,9 @@ async def test_delete_feed_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_feed() + await client.delete_feed(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.DeleteFeedRequest() @@ -3716,20 +3732,21 @@ def test_search_all_resources(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_search_all_resources_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.search_all_resources), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.search_all_resources() + call.return_value = asset_service.SearchAllResourcesResponse() + client.search_all_resources(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.SearchAllResourcesRequest() @@ -3800,13 +3817,12 @@ def test_search_all_resources_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_search_all_resources_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3817,7 +3833,9 @@ async def test_search_all_resources_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllResourcesResponse( next_page_token='next_page_token_value', )) - await client.search_all_resources() + await client.search_all_resources(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.SearchAllResourcesRequest() @@ -4290,20 +4308,21 @@ def test_search_all_iam_policies(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_search_all_iam_policies_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.search_all_iam_policies), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.search_all_iam_policies() + call.return_value = asset_service.SearchAllIamPoliciesResponse() + client.search_all_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.SearchAllIamPoliciesRequest() @@ -4374,13 +4393,12 @@ def test_search_all_iam_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_search_all_iam_policies_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4391,7 +4409,9 @@ async def test_search_all_iam_policies_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllIamPoliciesResponse( next_page_token='next_page_token_value', )) - await client.search_all_iam_policies() + await client.search_all_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.SearchAllIamPoliciesRequest() @@ -4854,20 +4874,21 @@ def test_analyze_iam_policy(request_type, transport: str = 'grpc'): assert response.fully_explored is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_iam_policy_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_iam_policy), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_iam_policy() + call.return_value = asset_service.AnalyzeIamPolicyResponse() + client.analyze_iam_policy(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeIamPolicyRequest() @@ -4932,13 +4953,12 @@ def test_analyze_iam_policy_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_iam_policy_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4949,7 +4969,9 @@ async def test_analyze_iam_policy_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeIamPolicyResponse( fully_explored=True, )) - await client.analyze_iam_policy() + await client.analyze_iam_policy(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeIamPolicyRequest() @@ -5121,20 +5143,21 @@ def test_analyze_iam_policy_longrunning(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_iam_policy_longrunning_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_iam_policy_longrunning), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_iam_policy_longrunning() + call.return_value = operations_pb2.Operation(name='operations/op') + client.analyze_iam_policy_longrunning(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() @@ -5204,13 +5227,12 @@ def test_analyze_iam_policy_longrunning_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_iam_policy_longrunning_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5221,7 +5243,9 @@ async def test_analyze_iam_policy_longrunning_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.analyze_iam_policy_longrunning() + await client.analyze_iam_policy_longrunning(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() @@ -5398,20 +5422,21 @@ def test_analyze_move(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.AnalyzeMoveResponse) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_move_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_move), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_move() + call.return_value = asset_service.AnalyzeMoveResponse() + client.analyze_move(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeMoveRequest() @@ -5478,13 +5503,12 @@ def test_analyze_move_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_move_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5494,7 +5518,9 @@ async def test_analyze_move_empty_call_async(): # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeMoveResponse( )) - await client.analyze_move() + await client.analyze_move(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeMoveRequest() @@ -5669,20 +5695,21 @@ def test_query_assets(request_type, transport: str = 'grpc'): assert response.done is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_query_assets_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.query_assets), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.query_assets() + call.return_value = asset_service.QueryAssetsResponse() + client.query_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.QueryAssetsRequest() @@ -5753,13 +5780,12 @@ def test_query_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_query_assets_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5771,7 +5797,9 @@ async def test_query_assets_empty_call_async(): job_reference='job_reference_value', done=True, )) - await client.query_assets() + await client.query_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.QueryAssetsRequest() @@ -5954,20 +5982,21 @@ def test_create_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_saved_query_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_saved_query), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_saved_query() + call.return_value = asset_service.SavedQuery() + client.create_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.CreateSavedQueryRequest() @@ -6034,13 +6063,12 @@ def test_create_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_saved_query_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6054,7 +6082,9 @@ async def test_create_saved_query_empty_call_async(): creator='creator_value', last_updater='last_updater_value', )) - await client.create_saved_query() + await client.create_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.CreateSavedQueryRequest() @@ -6343,20 +6373,21 @@ def test_get_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_saved_query_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_saved_query), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_saved_query() + call.return_value = asset_service.SavedQuery() + client.get_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.GetSavedQueryRequest() @@ -6421,13 +6452,12 @@ def test_get_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_saved_query_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6441,7 +6471,9 @@ async def test_get_saved_query_empty_call_async(): creator='creator_value', last_updater='last_updater_value', )) - await client.get_saved_query() + await client.get_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.GetSavedQueryRequest() @@ -6704,20 +6736,21 @@ def test_list_saved_queries(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_saved_queries_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_saved_queries), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_saved_queries() + call.return_value = asset_service.ListSavedQueriesResponse() + client.list_saved_queries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListSavedQueriesRequest() @@ -6786,13 +6819,12 @@ def test_list_saved_queries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_saved_queries_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6803,7 +6835,9 @@ async def test_list_saved_queries_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListSavedQueriesResponse( next_page_token='next_page_token_value', )) - await client.list_saved_queries() + await client.list_saved_queries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.ListSavedQueriesRequest() @@ -7262,20 +7296,21 @@ def test_update_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_saved_query_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_saved_query), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_saved_query() + call.return_value = asset_service.SavedQuery() + client.update_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.UpdateSavedQueryRequest() @@ -7338,13 +7373,12 @@ def test_update_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_saved_query_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7358,7 +7392,9 @@ async def test_update_saved_query_empty_call_async(): creator='creator_value', last_updater='last_updater_value', )) - await client.update_saved_query() + await client.update_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.UpdateSavedQueryRequest() @@ -7628,20 +7664,21 @@ def test_delete_saved_query(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_saved_query_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_saved_query), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_saved_query() + call.return_value = None + client.delete_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.DeleteSavedQueryRequest() @@ -7706,13 +7743,12 @@ def test_delete_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_saved_query_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7721,7 +7757,9 @@ async def test_delete_saved_query_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_saved_query() + await client.delete_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.DeleteSavedQueryRequest() @@ -7973,20 +8011,21 @@ def test_batch_get_effective_iam_policies(request_type, transport: str = 'grpc') assert isinstance(response, asset_service.BatchGetEffectiveIamPoliciesResponse) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_batch_get_effective_iam_policies_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.batch_get_effective_iam_policies), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.batch_get_effective_iam_policies() + call.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse() + client.batch_get_effective_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() @@ -8051,13 +8090,12 @@ def test_batch_get_effective_iam_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_batch_get_effective_iam_policies_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8067,7 +8105,9 @@ async def test_batch_get_effective_iam_policies_empty_call_async(): # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetEffectiveIamPoliciesResponse( )) - await client.batch_get_effective_iam_policies() + await client.batch_get_effective_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() @@ -8240,20 +8280,21 @@ def test_analyze_org_policies(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_org_policies_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_org_policies), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_org_policies() + call.return_value = asset_service.AnalyzeOrgPoliciesResponse() + client.analyze_org_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() @@ -8324,13 +8365,12 @@ def test_analyze_org_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_org_policies_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8341,7 +8381,9 @@ async def test_analyze_org_policies_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPoliciesResponse( next_page_token='next_page_token_value', )) - await client.analyze_org_policies() + await client.analyze_org_policies(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() @@ -8814,20 +8856,21 @@ def test_analyze_org_policy_governed_containers(request_type, transport: str = ' assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_org_policy_governed_containers_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_org_policy_governed_containers), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_org_policy_governed_containers() + call.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse() + client.analyze_org_policy_governed_containers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() @@ -8898,13 +8941,12 @@ def test_analyze_org_policy_governed_containers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_org_policy_governed_containers_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8915,7 +8957,9 @@ async def test_analyze_org_policy_governed_containers_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedContainersResponse( next_page_token='next_page_token_value', )) - await client.analyze_org_policy_governed_containers() + await client.analyze_org_policy_governed_containers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() @@ -9388,20 +9432,21 @@ def test_analyze_org_policy_governed_assets(request_type, transport: str = 'grpc assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_analyze_org_policy_governed_assets_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.analyze_org_policy_governed_assets), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.analyze_org_policy_governed_assets() + call.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse() + client.analyze_org_policy_governed_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() @@ -9472,13 +9517,12 @@ def test_analyze_org_policy_governed_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_analyze_org_policy_governed_assets_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9489,7 +9533,9 @@ async def test_analyze_org_policy_governed_assets_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedAssetsResponse( next_page_token='next_page_token_value', )) - await client.analyze_org_policy_governed_assets() + await client.analyze_org_policy_governed_assets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 2e96e2aebf..53017aa9ec 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -808,20 +808,21 @@ def test_generate_access_token(request_type, transport: str = 'grpc'): assert response.access_token == 'access_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_generate_access_token_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.generate_access_token), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.generate_access_token() + call.return_value = common.GenerateAccessTokenResponse() + client.generate_access_token(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.GenerateAccessTokenRequest() @@ -886,13 +887,12 @@ def test_generate_access_token_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_generate_access_token_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -903,7 +903,9 @@ async def test_generate_access_token_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateAccessTokenResponse( access_token='access_token_value', )) - await client.generate_access_token() + await client.generate_access_token(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.GenerateAccessTokenRequest() @@ -1186,20 +1188,21 @@ def test_generate_id_token(request_type, transport: str = 'grpc'): assert response.token == 'token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_generate_id_token_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.generate_id_token), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.generate_id_token() + call.return_value = common.GenerateIdTokenResponse() + client.generate_id_token(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.GenerateIdTokenRequest() @@ -1266,13 +1269,12 @@ def test_generate_id_token_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_generate_id_token_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1283,7 +1285,9 @@ async def test_generate_id_token_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateIdTokenResponse( token='token_value', )) - await client.generate_id_token() + await client.generate_id_token(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.GenerateIdTokenRequest() @@ -1572,20 +1576,21 @@ def test_sign_blob(request_type, transport: str = 'grpc'): assert response.signed_blob == b'signed_blob_blob' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_sign_blob_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.sign_blob), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.sign_blob() + call.return_value = common.SignBlobResponse() + client.sign_blob(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.SignBlobRequest() @@ -1650,13 +1655,12 @@ def test_sign_blob_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_sign_blob_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1668,7 +1672,9 @@ async def test_sign_blob_empty_call_async(): key_id='key_id_value', signed_blob=b'signed_blob_blob', )) - await client.sign_blob() + await client.sign_blob(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.SignBlobRequest() @@ -1949,20 +1955,21 @@ def test_sign_jwt(request_type, transport: str = 'grpc'): assert response.signed_jwt == 'signed_jwt_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_sign_jwt_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.sign_jwt), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.sign_jwt() + call.return_value = common.SignJwtResponse() + client.sign_jwt(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.SignJwtRequest() @@ -2029,13 +2036,12 @@ def test_sign_jwt_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_sign_jwt_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2047,7 +2053,9 @@ async def test_sign_jwt_empty_call_async(): key_id='key_id_value', signed_jwt='signed_jwt_value', )) - await client.sign_jwt() + await client.sign_jwt(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == common.SignJwtRequest() diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index 225cf30b7a..dfd564f669 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -836,20 +836,21 @@ def test_get_trigger(request_type, transport: str = 'grpc'): assert response.etag == 'etag_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_trigger_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_trigger), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_trigger() + call.return_value = trigger.Trigger() + client.get_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetTriggerRequest() @@ -914,13 +915,12 @@ def test_get_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_trigger_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -935,7 +935,9 @@ async def test_get_trigger_empty_call_async(): channel='channel_value', etag='etag_value', )) - await client.get_trigger() + await client.get_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetTriggerRequest() @@ -1202,20 +1204,21 @@ def test_list_triggers(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_triggers_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_triggers), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_triggers() + call.return_value = eventarc.ListTriggersResponse() + client.list_triggers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListTriggersRequest() @@ -1286,13 +1289,12 @@ def test_list_triggers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_triggers_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1304,7 +1306,9 @@ async def test_list_triggers_empty_call_async(): next_page_token='next_page_token_value', unreachable=['unreachable_value'], )) - await client.list_triggers() + await client.list_triggers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListTriggersRequest() @@ -1756,20 +1760,21 @@ def test_create_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_trigger_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_trigger), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_trigger() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateTriggerRequest() @@ -1841,13 +1846,12 @@ def test_create_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_trigger_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1858,7 +1862,9 @@ async def test_create_trigger_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_trigger() + await client.create_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateTriggerRequest() @@ -2138,20 +2144,21 @@ def test_update_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_trigger_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_trigger), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_trigger() + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateTriggerRequest() @@ -2219,13 +2226,12 @@ def test_update_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_trigger_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2236,7 +2242,9 @@ async def test_update_trigger_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.update_trigger() + await client.update_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateTriggerRequest() @@ -2516,20 +2524,21 @@ def test_delete_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_trigger_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_trigger), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_trigger() + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteTriggerRequest() @@ -2601,13 +2610,12 @@ def test_delete_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_trigger_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2618,7 +2626,9 @@ async def test_delete_trigger_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.delete_trigger() + await client.delete_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteTriggerRequest() @@ -2902,20 +2912,21 @@ def test_get_channel(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_channel_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_channel), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_channel() + call.return_value = channel.Channel() + client.get_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetChannelRequest() @@ -2980,13 +2991,12 @@ def test_get_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_channel_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3002,7 +3012,9 @@ async def test_get_channel_empty_call_async(): activation_token='activation_token_value', crypto_key_name='crypto_key_name_value', )) - await client.get_channel() + await client.get_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetChannelRequest() @@ -3271,20 +3283,21 @@ def test_list_channels(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_channels_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_channels), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_channels() + call.return_value = eventarc.ListChannelsResponse() + client.list_channels(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListChannelsRequest() @@ -3353,13 +3366,12 @@ def test_list_channels_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_channels_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3371,7 +3383,9 @@ async def test_list_channels_empty_call_async(): next_page_token='next_page_token_value', unreachable=['unreachable_value'], )) - await client.list_channels() + await client.list_channels(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListChannelsRequest() @@ -3823,20 +3837,21 @@ def test_create_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_channel_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_channel_), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_channel() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateChannelRequest() @@ -3908,13 +3923,12 @@ def test_create_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_channel_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3925,7 +3939,9 @@ async def test_create_channel_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_channel() + await client.create_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateChannelRequest() @@ -4205,20 +4221,21 @@ def test_update_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_channel_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_channel), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_channel() + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateChannelRequest() @@ -4286,13 +4303,12 @@ def test_update_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_channel_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4303,7 +4319,9 @@ async def test_update_channel_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.update_channel() + await client.update_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateChannelRequest() @@ -4573,20 +4591,21 @@ def test_delete_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_channel_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_channel), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_channel() + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteChannelRequest() @@ -4656,13 +4675,12 @@ def test_delete_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_channel_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4673,7 +4691,9 @@ async def test_delete_channel_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.delete_channel() + await client.delete_channel(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteChannelRequest() @@ -4938,20 +4958,21 @@ def test_get_provider(request_type, transport: str = 'grpc'): assert response.display_name == 'display_name_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_provider_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_provider), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_provider() + call.return_value = discovery.Provider() + client.get_provider(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetProviderRequest() @@ -5016,13 +5037,12 @@ def test_get_provider_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_provider_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5034,7 +5054,9 @@ async def test_get_provider_empty_call_async(): name='name_value', display_name='display_name_value', )) - await client.get_provider() + await client.get_provider(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetProviderRequest() @@ -5295,20 +5317,21 @@ def test_list_providers(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_providers_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_providers), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_providers() + call.return_value = eventarc.ListProvidersResponse() + client.list_providers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListProvidersRequest() @@ -5379,13 +5402,12 @@ def test_list_providers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_providers_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5397,7 +5419,9 @@ async def test_list_providers_empty_call_async(): next_page_token='next_page_token_value', unreachable=['unreachable_value'], )) - await client.list_providers() + await client.list_providers(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListProvidersRequest() @@ -5858,20 +5882,21 @@ def test_get_channel_connection(request_type, transport: str = 'grpc'): assert response.activation_token == 'activation_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_channel_connection_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_channel_connection), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_channel_connection() + call.return_value = channel_connection.ChannelConnection() + client.get_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetChannelConnectionRequest() @@ -5936,13 +5961,12 @@ def test_get_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_channel_connection_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5956,7 +5980,9 @@ async def test_get_channel_connection_empty_call_async(): channel='channel_value', activation_token='activation_token_value', )) - await client.get_channel_connection() + await client.get_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetChannelConnectionRequest() @@ -6221,20 +6247,21 @@ def test_list_channel_connections(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_channel_connections_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_channel_connections), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_channel_connections() + call.return_value = eventarc.ListChannelConnectionsResponse() + client.list_channel_connections(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListChannelConnectionsRequest() @@ -6301,13 +6328,12 @@ def test_list_channel_connections_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_channel_connections_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6319,7 +6345,9 @@ async def test_list_channel_connections_empty_call_async(): next_page_token='next_page_token_value', unreachable=['unreachable_value'], )) - await client.list_channel_connections() + await client.list_channel_connections(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.ListChannelConnectionsRequest() @@ -6771,20 +6799,21 @@ def test_create_channel_connection(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_channel_connection_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_channel_connection), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_channel_connection() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateChannelConnectionRequest() @@ -6856,13 +6885,12 @@ def test_create_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_channel_connection_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6873,7 +6901,9 @@ async def test_create_channel_connection_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_channel_connection() + await client.create_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.CreateChannelConnectionRequest() @@ -7153,20 +7183,21 @@ def test_delete_channel_connection(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_channel_connection_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_channel_connection), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_channel_connection() + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteChannelConnectionRequest() @@ -7236,13 +7267,12 @@ def test_delete_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_channel_connection_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7253,7 +7283,9 @@ async def test_delete_channel_connection_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.delete_channel_connection() + await client.delete_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.DeleteChannelConnectionRequest() @@ -7518,20 +7550,21 @@ def test_get_google_channel_config(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_google_channel_config_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_google_channel_config), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_google_channel_config() + call.return_value = google_channel_config.GoogleChannelConfig() + client.get_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetGoogleChannelConfigRequest() @@ -7596,13 +7629,12 @@ def test_get_google_channel_config_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_google_channel_config_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7614,7 +7646,9 @@ async def test_get_google_channel_config_empty_call_async(): name='name_value', crypto_key_name='crypto_key_name_value', )) - await client.get_google_channel_config() + await client.get_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.GetGoogleChannelConfigRequest() @@ -7875,20 +7909,21 @@ def test_update_google_channel_config(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_google_channel_config_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_google_channel_config), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_google_channel_config() + call.return_value = gce_google_channel_config.GoogleChannelConfig() + client.update_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() @@ -7951,13 +7986,12 @@ def test_update_google_channel_config_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_google_channel_config_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = EventarcAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7969,7 +8003,9 @@ async def test_update_google_channel_config_empty_call_async(): name='name_value', crypto_key_name='crypto_key_name_value', )) - await client.update_google_channel_config() + await client.update_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index 86f42cc044..b2d3f648f9 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -795,20 +795,21 @@ def test_list_buckets(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_buckets_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_buckets), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_buckets() + call.return_value = logging_config.ListBucketsResponse() + client.list_buckets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListBucketsRequest() @@ -875,13 +876,12 @@ def test_list_buckets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_buckets_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -892,7 +892,9 @@ async def test_list_buckets_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListBucketsResponse( next_page_token='next_page_token_value', )) - await client.list_buckets() + await client.list_buckets(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListBucketsRequest() @@ -1357,20 +1359,21 @@ def test_get_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_bucket_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_bucket), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_bucket() + call.return_value = logging_config.LogBucket() + client.get_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetBucketRequest() @@ -1435,13 +1438,12 @@ def test_get_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_bucket_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1458,7 +1460,9 @@ async def test_get_bucket_empty_call_async(): analytics_enabled=True, restricted_fields=['restricted_fields_value'], )) - await client.get_bucket() + await client.get_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetBucketRequest() @@ -1642,20 +1646,21 @@ def test_create_bucket_async(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_bucket_async_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_bucket_async), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_bucket_async() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateBucketRequest() @@ -1727,13 +1732,12 @@ def test_create_bucket_async_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_bucket_async_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1744,7 +1748,9 @@ async def test_create_bucket_async_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_bucket_async() + await client.create_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateBucketRequest() @@ -1920,20 +1926,21 @@ def test_update_bucket_async(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_bucket_async_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_bucket_async), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_bucket_async() + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateBucketRequest() @@ -2003,13 +2010,12 @@ def test_update_bucket_async_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_bucket_async_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2020,7 +2026,9 @@ async def test_update_bucket_async_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.update_bucket_async() + await client.update_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateBucketRequest() @@ -2211,20 +2219,21 @@ def test_create_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_bucket_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_bucket), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_bucket() + call.return_value = logging_config.LogBucket() + client.create_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateBucketRequest() @@ -2291,13 +2300,12 @@ def test_create_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_bucket_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2314,7 +2322,9 @@ async def test_create_bucket_empty_call_async(): analytics_enabled=True, restricted_fields=['restricted_fields_value'], )) - await client.create_bucket() + await client.create_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateBucketRequest() @@ -2513,20 +2523,21 @@ def test_update_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_bucket_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_bucket), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_bucket() + call.return_value = logging_config.LogBucket() + client.update_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateBucketRequest() @@ -2591,13 +2602,12 @@ def test_update_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_bucket_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2614,7 +2624,9 @@ async def test_update_bucket_empty_call_async(): analytics_enabled=True, restricted_fields=['restricted_fields_value'], )) - await client.update_bucket() + await client.update_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateBucketRequest() @@ -2798,20 +2810,21 @@ def test_delete_bucket(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_bucket_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_bucket), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_bucket() + call.return_value = None + client.delete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteBucketRequest() @@ -2876,13 +2889,12 @@ def test_delete_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_bucket_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2891,7 +2903,9 @@ async def test_delete_bucket_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_bucket() + await client.delete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteBucketRequest() @@ -3060,20 +3074,21 @@ def test_undelete_bucket(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_undelete_bucket_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.undelete_bucket), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.undelete_bucket() + call.return_value = None + client.undelete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UndeleteBucketRequest() @@ -3138,13 +3153,12 @@ def test_undelete_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_undelete_bucket_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3153,7 +3167,9 @@ async def test_undelete_bucket_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.undelete_bucket() + await client.undelete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UndeleteBucketRequest() @@ -3325,20 +3341,21 @@ def test_list_views(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_views_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_views), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_views() + call.return_value = logging_config.ListViewsResponse() + client.list_views(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListViewsRequest() @@ -3405,13 +3422,12 @@ def test_list_views_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_views_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3422,7 +3438,9 @@ async def test_list_views_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListViewsResponse( next_page_token='next_page_token_value', )) - await client.list_views() + await client.list_views(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListViewsRequest() @@ -3879,20 +3897,21 @@ def test_get_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_view_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_view), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_view() + call.return_value = logging_config.LogView() + client.get_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetViewRequest() @@ -3957,13 +3976,12 @@ def test_get_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_view_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3976,7 +3994,9 @@ async def test_get_view_empty_call_async(): description='description_value', filter='filter_value', )) - await client.get_view() + await client.get_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetViewRequest() @@ -4159,20 +4179,21 @@ def test_create_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_view_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_view), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_view() + call.return_value = logging_config.LogView() + client.create_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateViewRequest() @@ -4239,13 +4260,12 @@ def test_create_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_view_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4258,7 +4278,9 @@ async def test_create_view_empty_call_async(): description='description_value', filter='filter_value', )) - await client.create_view() + await client.create_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateViewRequest() @@ -4441,20 +4463,21 @@ def test_update_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_view_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_view), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_view() + call.return_value = logging_config.LogView() + client.update_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateViewRequest() @@ -4519,13 +4542,12 @@ def test_update_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_view_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4538,7 +4560,9 @@ async def test_update_view_empty_call_async(): description='description_value', filter='filter_value', )) - await client.update_view() + await client.update_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateViewRequest() @@ -4714,20 +4738,21 @@ def test_delete_view(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_view_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_view), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_view() + call.return_value = None + client.delete_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteViewRequest() @@ -4792,13 +4817,12 @@ def test_delete_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_view_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4807,7 +4831,9 @@ async def test_delete_view_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_view() + await client.delete_view(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteViewRequest() @@ -4979,20 +5005,21 @@ def test_list_sinks(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_sinks_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_sinks), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_sinks() + call.return_value = logging_config.ListSinksResponse() + client.list_sinks(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListSinksRequest() @@ -5059,13 +5086,12 @@ def test_list_sinks_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_sinks_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5076,7 +5102,9 @@ async def test_list_sinks_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListSinksResponse( next_page_token='next_page_token_value', )) - await client.list_sinks() + await client.list_sinks(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListSinksRequest() @@ -5543,20 +5571,21 @@ def test_get_sink(request_type, transport: str = 'grpc'): assert response.include_children is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_sink_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_sink), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_sink() + call.return_value = logging_config.LogSink() + client.get_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetSinkRequest() @@ -5621,13 +5650,12 @@ def test_get_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_sink_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5645,7 +5673,9 @@ async def test_get_sink_empty_call_async(): writer_identity='writer_identity_value', include_children=True, )) - await client.get_sink() + await client.get_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetSinkRequest() @@ -5930,20 +5960,21 @@ def test_create_sink(request_type, transport: str = 'grpc'): assert response.include_children is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_sink_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_sink), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_sink() + call.return_value = logging_config.LogSink() + client.create_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateSinkRequest() @@ -6008,13 +6039,12 @@ def test_create_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_sink_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6032,7 +6062,9 @@ async def test_create_sink_empty_call_async(): writer_identity='writer_identity_value', include_children=True, )) - await client.create_sink() + await client.create_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateSinkRequest() @@ -6327,20 +6359,21 @@ def test_update_sink(request_type, transport: str = 'grpc'): assert response.include_children is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_sink_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_sink), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_sink() + call.return_value = logging_config.LogSink() + client.update_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateSinkRequest() @@ -6405,13 +6438,12 @@ def test_update_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_sink_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6429,7 +6461,9 @@ async def test_update_sink_empty_call_async(): writer_identity='writer_identity_value', include_children=True, )) - await client.update_sink() + await client.update_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateSinkRequest() @@ -6717,20 +6751,21 @@ def test_delete_sink(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_sink_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_sink), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_sink() + call.return_value = None + client.delete_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteSinkRequest() @@ -6795,13 +6830,12 @@ def test_delete_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_sink_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6810,7 +6844,9 @@ async def test_delete_sink_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_sink() + await client.delete_sink(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteSinkRequest() @@ -7061,20 +7097,21 @@ def test_create_link(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_link_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_link), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_link() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateLinkRequest() @@ -7146,13 +7183,12 @@ def test_create_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_link_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7163,7 +7199,9 @@ async def test_create_link_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_link() + await client.create_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateLinkRequest() @@ -7443,20 +7481,21 @@ def test_delete_link(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_link_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_link), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_link() + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteLinkRequest() @@ -7526,13 +7565,12 @@ def test_delete_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_link_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7543,7 +7581,9 @@ async def test_delete_link_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.delete_link() + await client.delete_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteLinkRequest() @@ -7806,20 +7846,21 @@ def test_list_links(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_links_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_links), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_links() + call.return_value = logging_config.ListLinksResponse() + client.list_links(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListLinksRequest() @@ -7886,13 +7927,12 @@ def test_list_links_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_links_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7903,7 +7943,9 @@ async def test_list_links_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListLinksResponse( next_page_token='next_page_token_value', )) - await client.list_links() + await client.list_links(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListLinksRequest() @@ -8360,20 +8402,21 @@ def test_get_link(request_type, transport: str = 'grpc'): assert response.lifecycle_state == logging_config.LifecycleState.ACTIVE +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_link_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_link), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_link() + call.return_value = logging_config.Link() + client.get_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetLinkRequest() @@ -8438,13 +8481,12 @@ def test_get_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_link_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8457,7 +8499,9 @@ async def test_get_link_empty_call_async(): description='description_value', lifecycle_state=logging_config.LifecycleState.ACTIVE, )) - await client.get_link() + await client.get_link(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetLinkRequest() @@ -8718,20 +8762,21 @@ def test_list_exclusions(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_exclusions_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_exclusions), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_exclusions() + call.return_value = logging_config.ListExclusionsResponse() + client.list_exclusions(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListExclusionsRequest() @@ -8798,13 +8843,12 @@ def test_list_exclusions_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_exclusions_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8815,7 +8859,9 @@ async def test_list_exclusions_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListExclusionsResponse( next_page_token='next_page_token_value', )) - await client.list_exclusions() + await client.list_exclusions(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.ListExclusionsRequest() @@ -9274,20 +9320,21 @@ def test_get_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_exclusion_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_exclusion), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_exclusion() + call.return_value = logging_config.LogExclusion() + client.get_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetExclusionRequest() @@ -9352,13 +9399,12 @@ def test_get_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_exclusion_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9372,7 +9418,9 @@ async def test_get_exclusion_empty_call_async(): filter='filter_value', disabled=True, )) - await client.get_exclusion() + await client.get_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetExclusionRequest() @@ -9641,20 +9689,21 @@ def test_create_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_exclusion_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_exclusion), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_exclusion() + call.return_value = logging_config.LogExclusion() + client.create_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateExclusionRequest() @@ -9719,13 +9768,12 @@ def test_create_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_exclusion_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9739,7 +9787,9 @@ async def test_create_exclusion_empty_call_async(): filter='filter_value', disabled=True, )) - await client.create_exclusion() + await client.create_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CreateExclusionRequest() @@ -10018,20 +10068,21 @@ def test_update_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_exclusion_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_exclusion), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_exclusion() + call.return_value = logging_config.LogExclusion() + client.update_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateExclusionRequest() @@ -10096,13 +10147,12 @@ def test_update_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_exclusion_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10116,7 +10166,9 @@ async def test_update_exclusion_empty_call_async(): filter='filter_value', disabled=True, )) - await client.update_exclusion() + await client.update_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateExclusionRequest() @@ -10396,20 +10448,21 @@ def test_delete_exclusion(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_exclusion_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_exclusion), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_exclusion() + call.return_value = None + client.delete_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteExclusionRequest() @@ -10474,13 +10527,12 @@ def test_delete_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_exclusion_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10489,7 +10541,9 @@ async def test_delete_exclusion_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_exclusion() + await client.delete_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.DeleteExclusionRequest() @@ -10749,20 +10803,21 @@ def test_get_cmek_settings(request_type, transport: str = 'grpc'): assert response.service_account_id == 'service_account_id_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_cmek_settings_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_cmek_settings), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_cmek_settings() + call.return_value = logging_config.CmekSettings() + client.get_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetCmekSettingsRequest() @@ -10827,13 +10882,12 @@ def test_get_cmek_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_cmek_settings_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10847,7 +10901,9 @@ async def test_get_cmek_settings_empty_call_async(): kms_key_version_name='kms_key_version_name_value', service_account_id='service_account_id_value', )) - await client.get_cmek_settings() + await client.get_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetCmekSettingsRequest() @@ -11034,20 +11090,21 @@ def test_update_cmek_settings(request_type, transport: str = 'grpc'): assert response.service_account_id == 'service_account_id_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_cmek_settings_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_cmek_settings), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_cmek_settings() + call.return_value = logging_config.CmekSettings() + client.update_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateCmekSettingsRequest() @@ -11112,13 +11169,12 @@ def test_update_cmek_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_cmek_settings_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11132,7 +11188,9 @@ async def test_update_cmek_settings_empty_call_async(): kms_key_version_name='kms_key_version_name_value', service_account_id='service_account_id_value', )) - await client.update_cmek_settings() + await client.update_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateCmekSettingsRequest() @@ -11321,20 +11379,21 @@ def test_get_settings(request_type, transport: str = 'grpc'): assert response.disable_default_sink is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_settings_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_settings), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_settings() + call.return_value = logging_config.Settings() + client.get_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetSettingsRequest() @@ -11399,13 +11458,12 @@ def test_get_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_settings_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11420,7 +11478,9 @@ async def test_get_settings_empty_call_async(): storage_location='storage_location_value', disable_default_sink=True, )) - await client.get_settings() + await client.get_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.GetSettingsRequest() @@ -11693,20 +11753,21 @@ def test_update_settings(request_type, transport: str = 'grpc'): assert response.disable_default_sink is True +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_settings_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_settings), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_settings() + call.return_value = logging_config.Settings() + client.update_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateSettingsRequest() @@ -11771,13 +11832,12 @@ def test_update_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_settings_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11792,7 +11852,9 @@ async def test_update_settings_empty_call_async(): storage_location='storage_location_value', disable_default_sink=True, )) - await client.update_settings() + await client.update_settings(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.UpdateSettingsRequest() @@ -12064,20 +12126,21 @@ def test_copy_log_entries(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_copy_log_entries_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.copy_log_entries), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.copy_log_entries() + call.return_value = operations_pb2.Operation(name='operations/op') + client.copy_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CopyLogEntriesRequest() @@ -12151,13 +12214,12 @@ def test_copy_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_copy_log_entries_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12168,7 +12230,9 @@ async def test_copy_log_entries_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.copy_log_entries() + await client.copy_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_config.CopyLogEntriesRequest() diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 7602beb75d..9c10773b75 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -794,20 +794,21 @@ def test_delete_log(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_log_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_log), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_log() + call.return_value = None + client.delete_log(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.DeleteLogRequest() @@ -872,13 +873,12 @@ def test_delete_log_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_log_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -887,7 +887,9 @@ async def test_delete_log_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_log() + await client.delete_log(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.DeleteLogRequest() @@ -1139,20 +1141,21 @@ def test_write_log_entries(request_type, transport: str = 'grpc'): assert isinstance(response, logging.WriteLogEntriesResponse) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_write_log_entries_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.write_log_entries), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.write_log_entries() + call.return_value = logging.WriteLogEntriesResponse() + client.write_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.WriteLogEntriesRequest() @@ -1217,13 +1220,12 @@ def test_write_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_write_log_entries_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1233,7 +1235,9 @@ async def test_write_log_entries_empty_call_async(): # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.WriteLogEntriesResponse( )) - await client.write_log_entries() + await client.write_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.WriteLogEntriesRequest() @@ -1455,20 +1459,21 @@ def test_list_log_entries(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_log_entries_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_log_entries), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_log_entries() + call.return_value = logging.ListLogEntriesResponse() + client.list_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListLogEntriesRequest() @@ -1537,13 +1542,12 @@ def test_list_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_log_entries_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1554,7 +1558,9 @@ async def test_list_log_entries_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListLogEntriesResponse( next_page_token='next_page_token_value', )) - await client.list_log_entries() + await client.list_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListLogEntriesRequest() @@ -1959,20 +1965,21 @@ def test_list_monitored_resource_descriptors(request_type, transport: str = 'grp assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_monitored_resource_descriptors_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_monitored_resource_descriptors), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_monitored_resource_descriptors() + call.return_value = logging.ListMonitoredResourceDescriptorsResponse() + client.list_monitored_resource_descriptors(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() @@ -2037,13 +2044,12 @@ def test_list_monitored_resource_descriptors_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2054,7 +2060,9 @@ async def test_list_monitored_resource_descriptors_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListMonitoredResourceDescriptorsResponse( next_page_token='next_page_token_value', )) - await client.list_monitored_resource_descriptors() + await client.list_monitored_resource_descriptors(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() @@ -2359,20 +2367,21 @@ def test_list_logs(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_logs_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_logs), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_logs() + call.return_value = logging.ListLogsResponse() + client.list_logs(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListLogsRequest() @@ -2439,13 +2448,12 @@ def test_list_logs_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_logs_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2457,7 +2465,9 @@ async def test_list_logs_empty_call_async(): log_names=['log_names_value'], next_page_token='next_page_token_value', )) - await client.list_logs() + await client.list_logs(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging.ListLogsRequest() diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index 8ac1d16bae..175424fa4c 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -795,20 +795,21 @@ def test_list_log_metrics(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_log_metrics_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_log_metrics), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_log_metrics() + call.return_value = logging_metrics.ListLogMetricsResponse() + client.list_log_metrics(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.ListLogMetricsRequest() @@ -875,13 +876,12 @@ def test_list_log_metrics_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_log_metrics_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -892,7 +892,9 @@ async def test_list_log_metrics_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.ListLogMetricsResponse( next_page_token='next_page_token_value', )) - await client.list_log_metrics() + await client.list_log_metrics(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.ListLogMetricsRequest() @@ -1357,20 +1359,21 @@ def test_get_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_log_metric_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_log_metric), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_log_metric() + call.return_value = logging_metrics.LogMetric() + client.get_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.GetLogMetricRequest() @@ -1435,13 +1438,12 @@ def test_get_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_log_metric_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1458,7 +1460,9 @@ async def test_get_log_metric_empty_call_async(): value_extractor='value_extractor_value', version=logging_metrics.LogMetric.ApiVersion.V1, )) - await client.get_log_metric() + await client.get_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.GetLogMetricRequest() @@ -1739,20 +1743,21 @@ def test_create_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_log_metric_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_log_metric), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_log_metric() + call.return_value = logging_metrics.LogMetric() + client.create_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.CreateLogMetricRequest() @@ -1817,13 +1822,12 @@ def test_create_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_log_metric_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1840,7 +1844,9 @@ async def test_create_log_metric_empty_call_async(): value_extractor='value_extractor_value', version=logging_metrics.LogMetric.ApiVersion.V1, )) - await client.create_log_metric() + await client.create_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.CreateLogMetricRequest() @@ -2131,20 +2137,21 @@ def test_update_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_log_metric_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_log_metric), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_log_metric() + call.return_value = logging_metrics.LogMetric() + client.update_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.UpdateLogMetricRequest() @@ -2209,13 +2216,12 @@ def test_update_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_log_metric_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2232,7 +2238,9 @@ async def test_update_log_metric_empty_call_async(): value_extractor='value_extractor_value', version=logging_metrics.LogMetric.ApiVersion.V1, )) - await client.update_log_metric() + await client.update_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.UpdateLogMetricRequest() @@ -2508,20 +2516,21 @@ def test_delete_log_metric(request_type, transport: str = 'grpc'): assert response is None +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_log_metric_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_log_metric), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_log_metric() + call.return_value = None + client.delete_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.DeleteLogMetricRequest() @@ -2586,13 +2595,12 @@ def test_delete_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_log_metric_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2601,7 +2609,9 @@ async def test_delete_log_metric_empty_call_async(): '__call__') as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_log_metric() + await client.delete_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == logging_metrics.DeleteLogMetricRequest() diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index d9bacbf441..941640e981 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -821,20 +821,21 @@ def test_list_instances(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_list_instances_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_instances), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.list_instances() + call.return_value = cloud_redis.ListInstancesResponse() + client.list_instances(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ListInstancesRequest() @@ -901,13 +902,12 @@ def test_list_instances_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_instances_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -919,7 +919,9 @@ async def test_list_instances_empty_call_async(): next_page_token='next_page_token_value', unreachable=['unreachable_value'], )) - await client.list_instances() + await client.list_instances(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ListInstancesRequest() @@ -1426,20 +1428,21 @@ def test_get_instance(request_type, transport: str = 'grpc'): assert response.available_maintenance_versions == ['available_maintenance_versions_value'] +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_instance() + call.return_value = cloud_redis.Instance() + client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.GetInstanceRequest() @@ -1504,13 +1507,12 @@ def test_get_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1547,7 +1549,9 @@ async def test_get_instance_empty_call_async(): maintenance_version='maintenance_version_value', available_maintenance_versions=['available_maintenance_versions_value'], )) - await client.get_instance() + await client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.GetInstanceRequest() @@ -1856,20 +1860,21 @@ def test_get_instance_auth_string(request_type, transport: str = 'grpc'): assert response.auth_string == 'auth_string_value' +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_get_instance_auth_string_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.get_instance_auth_string), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.get_instance_auth_string() + call.return_value = cloud_redis.InstanceAuthString() + client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.GetInstanceAuthStringRequest() @@ -1934,13 +1939,12 @@ def test_get_instance_auth_string_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_instance_auth_string_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1951,7 +1955,9 @@ async def test_get_instance_auth_string_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.InstanceAuthString( auth_string='auth_string_value', )) - await client.get_instance_auth_string() + await client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.GetInstanceAuthStringRequest() @@ -2205,20 +2211,21 @@ def test_create_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_create_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.create_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.create_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.CreateInstanceRequest() @@ -2290,13 +2297,12 @@ def test_create_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2307,7 +2313,9 @@ async def test_create_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.create_instance() + await client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.CreateInstanceRequest() @@ -2587,20 +2595,21 @@ def test_update_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_update_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.update_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.update_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.UpdateInstanceRequest() @@ -2668,13 +2677,12 @@ def test_update_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2685,7 +2693,9 @@ async def test_update_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.update_instance() + await client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.UpdateInstanceRequest() @@ -2955,20 +2965,21 @@ def test_upgrade_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_upgrade_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.upgrade_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.upgrade_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.UpgradeInstanceRequest() @@ -3040,13 +3051,12 @@ def test_upgrade_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_upgrade_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3057,7 +3067,9 @@ async def test_upgrade_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.upgrade_instance() + await client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.UpgradeInstanceRequest() @@ -3327,20 +3339,21 @@ def test_import_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_import_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.import_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.import_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ImportInstanceRequest() @@ -3410,13 +3423,12 @@ def test_import_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_import_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3427,7 +3439,9 @@ async def test_import_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.import_instance() + await client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ImportInstanceRequest() @@ -3697,20 +3711,21 @@ def test_export_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_export_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.export_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.export_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ExportInstanceRequest() @@ -3780,13 +3795,12 @@ def test_export_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_export_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3797,7 +3811,9 @@ async def test_export_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.export_instance() + await client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.ExportInstanceRequest() @@ -4067,20 +4083,21 @@ def test_failover_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_failover_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.failover_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.failover_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.FailoverInstanceRequest() @@ -4150,13 +4167,12 @@ def test_failover_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_failover_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4167,7 +4183,9 @@ async def test_failover_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.failover_instance() + await client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.FailoverInstanceRequest() @@ -4437,20 +4455,21 @@ def test_delete_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_delete_instance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.delete_instance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.delete_instance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.DeleteInstanceRequest() @@ -4520,13 +4539,12 @@ def test_delete_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_instance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4537,7 +4555,9 @@ async def test_delete_instance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.delete_instance() + await client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.DeleteInstanceRequest() @@ -4797,20 +4817,21 @@ def test_reschedule_maintenance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. def test_reschedule_maintenance_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.reschedule_maintenance), '__call__') as call: - call.return_value.name = "foo" # operation_request.operation in compute client(s) expect a string. - client.reschedule_maintenance() + call.return_value = operations_pb2.Operation(name='operations/op') + client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.RescheduleMaintenanceRequest() @@ -4880,13 +4901,12 @@ def test_reschedule_maintenance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_reschedule_maintenance_empty_call_async(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), - transport='grpc_asyncio', ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4897,7 +4917,9 @@ async def test_reschedule_maintenance_empty_call_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name='operations/spam') ) - await client.reschedule_maintenance() + await client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == cloud_redis.RescheduleMaintenanceRequest() From 78acc42350dbbcc04e6759a28fd6b4e525f94f3c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 3 Sep 2024 16:50:03 +0000 Subject: [PATCH 02/23] method_name -> method.name --- .../unit/gapic/%name_%version/%sub/test_macros.j2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 04a16f5116..2c740119f2 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -125,7 +125,7 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): {% if not method.client_streaming %} # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -{{ method_call_test("empty_call", method, method_name, service, api, uuid4_re, request=None)}} +{{ method_call_test("empty_call", method, service, api, uuid4_re, request=None)}} def test_{{ method_name }}_non_empty_request_with_auto_populated_field(): @@ -223,7 +223,7 @@ def test_{{ method_name }}_use_cached_wrapped_rpc(): {% if not method.client_streaming %} # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -{{ method_call_test("empty_call", method, method_name, service, api, uuid4_re, request=None, is_async=True) }} +{{ method_call_test("empty_call", method, service, api, uuid4_re, request=None, is_async=True) }} {% endif %} @pytest.mark.asyncio @@ -1812,14 +1812,14 @@ def test_{{ method_name }}_rest_no_http_options(): {% endmacro %} -{% macro method_call_test(test_name, method, method_name, service, api, uuid4_re, request, is_async=False) %} +{% macro method_call_test(test_name, method, service, api, uuid4_re, request, is_async=False) %} {% set await_prefix = "await " if is_async else "" %} {% set async_method_prefix = "async " if is_async else "" %} {% set async_method_suffix = "_async" if is_async else "" %} {% if is_async %} @pytest.mark.asyncio {% endif %}{# is_async #} -{{ async_method_prefix }}def test_{{ method_name }}_{{ test_name }}{{ async_method_suffix }}(): +{{ async_method_prefix }}def test_{{ method.name }}_{{ test_name }}{{ async_method_suffix }}(): {% if is_async %} client = {{ service.async_client_name }}( credentials=async_anonymous_credentials(), @@ -1858,7 +1858,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endfor %} )) {% endif %}{# method.void #} - await client.{{ method_name }}(request={{ request }}) + await client.{{ method.name }}(request={{ request }}) {% else %}{# if not is_async #} {% if method.void %} call.return_value = None @@ -1869,7 +1869,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% else %} call.return_value = {{ method.output.ident }}() {% endif %} - client.{{ method_name }}(request={{ request }}) + client.{{ method.name }}(request={{ request }}) {% endif %}{# is_async #} # Establish that the underlying gRPC stub method was called. From ea9f8235724a3af352715593ad233f3b0188b6df Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 5 Sep 2024 14:57:44 +0000 Subject: [PATCH 03/23] method.name -> method.safe_name|snake_case --- .../tests/unit/gapic/%name_%version/%sub/test_macros.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 2c740119f2..e1df059654 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1819,7 +1819,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% if is_async %} @pytest.mark.asyncio {% endif %}{# is_async #} -{{ async_method_prefix }}def test_{{ method.name }}_{{ test_name }}{{ async_method_suffix }}(): +{{ async_method_prefix }}def test_{{ method.safe_name|snake_case }}_{{ test_name }}{{ async_method_suffix }}(): {% if is_async %} client = {{ service.async_client_name }}( credentials=async_anonymous_credentials(), @@ -1858,7 +1858,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endfor %} )) {% endif %}{# method.void #} - await client.{{ method.name }}(request={{ request }}) + await client.{{ method.safe_name|snake_case }}(request={{ request }}) {% else %}{# if not is_async #} {% if method.void %} call.return_value = None @@ -1869,7 +1869,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% else %} call.return_value = {{ method.output.ident }}() {% endif %} - client.{{ method.name }}(request={{ request }}) + client.{{ method.safe_name|snake_case }}(request={{ request }}) {% endif %}{# is_async #} # Establish that the underlying gRPC stub method was called. From d9a46bdc9c36f12a228d9c20656c8145200f0054 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 7 Sep 2024 13:24:17 +0000 Subject: [PATCH 04/23] add with block --- .../tests/unit/gapic/%name_%version/%sub/test_macros.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index e1df059654..58d4bae4d3 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1813,13 +1813,14 @@ def test_{{ method_name }}_rest_no_http_options(): {% macro method_call_test(test_name, method, service, api, uuid4_re, request, is_async=False) %} +{% with method_name = method.name|snake_case + "_unary" if method.operation_service else method.name|snake_case %} {% set await_prefix = "await " if is_async else "" %} {% set async_method_prefix = "async " if is_async else "" %} {% set async_method_suffix = "_async" if is_async else "" %} {% if is_async %} @pytest.mark.asyncio {% endif %}{# is_async #} -{{ async_method_prefix }}def test_{{ method.safe_name|snake_case }}_{{ test_name }}{{ async_method_suffix }}(): +{{ async_method_prefix }}def test_{{ method_name }}_{{ test_name }}{{ async_method_suffix }}(): {% if is_async %} client = {{ service.async_client_name }}( credentials=async_anonymous_credentials(), @@ -1858,7 +1859,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endfor %} )) {% endif %}{# method.void #} - await client.{{ method.safe_name|snake_case }}(request={{ request }}) + await client.{{ method_name }}(request={{ request }}) {% else %}{# if not is_async #} {% if method.void %} call.return_value = None @@ -1869,7 +1870,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% else %} call.return_value = {{ method.output.ident }}() {% endif %} - client.{{ method.safe_name|snake_case }}(request={{ request }}) + client.{{ method_name }}(request={{ request }}) {% endif %}{# is_async #} # Establish that the underlying gRPC stub method was called. @@ -1890,6 +1891,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% else %} assert args[0] == {{ method.input.ident }}() {% endif %}{# request #} +{% endwith %}{# method_name #} {% endmacro %} From 7288f404ee8bf559ef0ea134d5c9cd769c9bc12f Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 7 Sep 2024 13:30:23 +0000 Subject: [PATCH 05/23] use get_credentials and get_client macro --- .../unit/gapic/%name_%version/%sub/test_macros.j2 | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index d86fd65fdd..0c97b9760a 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1821,16 +1821,9 @@ def test_{{ method_name }}_rest_no_http_options(): @pytest.mark.asyncio {% endif %}{# is_async #} {{ async_method_prefix }}def test_{{ method_name }}_{{ test_name }}{{ async_method_suffix }}(): -{% if is_async %} - client = {{ service.async_client_name }}( - credentials=async_anonymous_credentials(), - ) -{% else %} - client = {{ service.client_name }}( - credentials=ga_credentials.AnonymousCredentials(), + client = {{ get_client(service=service, is_async=is_async) }}( + credentials={{ get_credentials(is_async=is_async) }}, ) -{% endif %}{# is_async #} - # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.{{ method.transport_safe_name|snake_case }}), From 99fb4630aeda12755573d59e77231926b69d0eb5 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 7 Sep 2024 13:39:20 +0000 Subject: [PATCH 06/23] restore new line --- .../tests/unit/gapic/%name_%version/%sub/test_macros.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 0c97b9760a..0e1df35112 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1824,6 +1824,7 @@ def test_{{ method_name }}_rest_no_http_options(): client = {{ get_client(service=service, is_async=is_async) }}( credentials={{ get_credentials(is_async=is_async) }}, ) + # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.{{ method.transport_safe_name|snake_case }}), From e53b87f304fb45edaaced6d9dcf86f92e638a5f9 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 9 Sep 2024 00:26:43 +0000 Subject: [PATCH 07/23] use common testing framework --- .../%name_%version/%sub/test_%service.py.j2 | 5 +- .../gapic/%name_%version/%sub/test_macros.j2 | 37 +- .../unit/gapic/asset_v1/test_asset_service.py | 2484 ++++++++------ .../credentials_v1/test_iam_credentials.py | 427 ++- .../unit/gapic/eventarc_v1/test_eventarc.py | 1971 ++++++----- .../logging_v2/test_config_service_v2.py | 2898 ++++++++--------- .../logging_v2/test_logging_service_v2.py | 429 ++- .../logging_v2/test_metrics_service_v2.py | 464 ++- .../unit/gapic/redis_v1/test_cloud_redis.py | 1533 ++++++--- 9 files changed, 5708 insertions(+), 4540 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index 6f467a56a6..d6d1931190 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -1045,14 +1045,15 @@ def test_transport_adc(transport_class): {% set configs = [] %} {% for transport in opts.transport %} - {% do configs.append({'service':service, 'transport':transport, 'is_async':false}) %} + {% do configs.append({'service':service, 'api':api, 'transport':transport, 'is_async':false}) %} {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121): Remove this condition when async rest is GA. #} {% if 'grpc' in transport or rest_async_io_enabled %} - {% do configs.append({'service':service, 'transport':transport, 'is_async':true}) %} + {% do configs.append({'service':service, 'api':api, 'transport':transport, 'is_async':true}) %} {% endif %} {% endfor %} {% for conf in configs %} {{ test_macros.transport_kind_test(**conf) }} +{{ test_macros.empty_call_test(**conf) }} {% endfor %} {% if 'grpc' in opts.transport %} diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 0e1df35112..f307a5218c 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1,6 +1,5 @@ {% macro grpc_required_tests(method, service, api, full_extended_lro=False) %} {% with method_name = method.safe_name|snake_case + "_unary" if method.extended_lro and not full_extended_lro else method.safe_name|snake_case, method_output = method.extended_lro.operation_type if method.extended_lro and not full_extended_lro else method.output %} -{% with uuid4_re = "[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}" %} @pytest.mark.parametrize("request_type", [ {{ method.input.ident }}, dict, @@ -123,11 +122,6 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): {% if not method.client_streaming %} -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -{{ method_call_test("empty_call", method, service, api, uuid4_re, request=None)}} - - def test_{{ method_name }}_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -157,7 +151,7 @@ def test_{{ method_name }}_non_empty_request_with_auto_populated_field(): {% if method_settings is not none %} {% for auto_populated_field in method_settings.auto_populated_fields %} # Ensure that the uuid4 field is set according to AIP 4235 - assert re.match(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }}) + assert re.match(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }}) # clear UUID field so that the check below succeeds args[0].{{ auto_populated_field }} = None {% endfor %} @@ -220,12 +214,6 @@ def test_{{ method_name }}_use_cached_wrapped_rpc(): assert mock_rpc.call_count == 2 {% if not full_extended_lro %} -{% if not method.client_streaming %} -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -{{ method_call_test("empty_call", method, service, api, uuid4_re, request=None, is_async=True) }} -{% endif %} - @pytest.mark.asyncio async def test_{{ method_name }}_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1048,7 +1036,6 @@ def test_{{ method_name }}_raw_page_lro(): response = {{ method.lro.response_type.ident }}() assert response.raw_page is response {% endif %}{# method.paged_result_field #}{% endwith %} -{% endwith %}{# uuid4_re #} {% endmacro %} {% macro rest_required_tests(method, service, numeric_enums=False, full_extended_lro=False) %} @@ -1812,7 +1799,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endmacro %} -{% macro method_call_test(test_name, method, service, api, uuid4_re, request, is_async=False) %} +{% macro method_call_test(test_name, method, service, api, request, is_async=False) %} {% with method_name = method.name|snake_case + "_unary" if method.operation_service else method.name|snake_case %} {% set await_prefix = "await " if is_async else "" %} {% set async_method_prefix = "async " if is_async else "" %} @@ -1874,7 +1861,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% if method_settings is not none %} {% for auto_populated_field in method_settings.auto_populated_fields %} # Ensure that the uuid4 field is set according to AIP 4235 - assert re.match(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }}) + assert re.match(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }}) # clear UUID field so that the check below succeeds args[0].{{ auto_populated_field }} = None {% endfor %}{# for auto_populated_field in method_settings.auto_populated_fields #} @@ -1900,7 +1887,7 @@ def test_{{ method_name }}_rest_no_http_options(): {{- transport + ("_asyncio" if is_async else "") -}} {% endmacro %} -{% macro transport_kind_test(service, transport, is_async) %} +{% macro transport_kind_test(service, api, transport, is_async) %} {% set transport_name = get_transport_name(transport, is_async) %} def test_transport_kind_{{ transport_name }}(): transport = {{ get_client(service, is_async) }}.get_transport_class("{{ transport_name }}")( @@ -1908,4 +1895,18 @@ def test_transport_kind_{{ transport_name }}(): ) assert transport.kind == "{{ transport_name }}" -{% endmacro %} +{% endmacro %}{# transport_kind_test #} + +{% macro empty_call_test(service, api, transport, is_async) %} +{% for method in service.methods.values() %}{# method #} +{% if not method.client_streaming %} +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +{{ method_call_test("empty_call", method, service, api, request=None, is_async=is_async) }} +{% endif %}{# not method.client_streaming #} +{% endfor %}{# method in service.methods.values() #} +{% endmacro %}{# empty_call_test #} + +{% macro get_uuid4_re() -%} +[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12} +{%- endmacro %}{# uuid_re #} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index b11ece5883..5b83567e79 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -815,26 +815,6 @@ def test_export_assets(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_export_assets_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.export_assets), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.export_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() - - def test_export_assets_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -899,30 +879,6 @@ def test_export_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_export_assets_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.export_assets), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.export_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() - - @pytest.mark.asyncio async def test_export_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1096,26 +1052,6 @@ def test_list_assets(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_assets_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_assets), - '__call__') as call: - call.return_value = asset_service.ListAssetsResponse() - client.list_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() - - def test_list_assets_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1177,30 +1113,6 @@ def test_list_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_assets_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_assets), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListAssetsResponse( - next_page_token='next_page_token_value', - )) - await client.list_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() - - @pytest.mark.asyncio async def test_list_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1646,26 +1558,6 @@ def test_batch_get_assets_history(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.BatchGetAssetsHistoryResponse) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_batch_get_assets_history_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.batch_get_assets_history), - '__call__') as call: - call.return_value = asset_service.BatchGetAssetsHistoryResponse() - client.batch_get_assets_history(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() - - def test_batch_get_assets_history_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1725,29 +1617,6 @@ def test_batch_get_assets_history_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_batch_get_assets_history_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.batch_get_assets_history), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetAssetsHistoryResponse( - )) - await client.batch_get_assets_history(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() - - @pytest.mark.asyncio async def test_batch_get_assets_history_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1923,26 +1792,6 @@ def test_create_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_feed_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_feed), - '__call__') as call: - call.return_value = asset_service.Feed() - client.create_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() - - def test_create_feed_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2004,34 +1853,6 @@ def test_create_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_feed_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_feed), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( - name='name_value', - asset_names=['asset_names_value'], - asset_types=['asset_types_value'], - content_type=asset_service.ContentType.RESOURCE, - relationship_types=['relationship_types_value'], - )) - await client.create_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() - - @pytest.mark.asyncio async def test_create_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2299,26 +2120,6 @@ def test_get_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_feed_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_feed), - '__call__') as call: - call.return_value = asset_service.Feed() - client.get_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() - - def test_get_feed_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2378,34 +2179,6 @@ def test_get_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_feed_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_feed), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( - name='name_value', - asset_names=['asset_names_value'], - asset_types=['asset_types_value'], - content_type=asset_service.ContentType.RESOURCE, - relationship_types=['relationship_types_value'], - )) - await client.get_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() - - @pytest.mark.asyncio async def test_get_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2663,26 +2436,6 @@ def test_list_feeds(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.ListFeedsResponse) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_feeds_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_feeds), - '__call__') as call: - call.return_value = asset_service.ListFeedsResponse() - client.list_feeds(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() - - def test_list_feeds_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2742,29 +2495,6 @@ def test_list_feeds_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_feeds_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_feeds), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListFeedsResponse( - )) - await client.list_feeds(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() - - @pytest.mark.asyncio async def test_list_feeds_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3022,26 +2752,6 @@ def test_update_feed(request_type, transport: str = 'grpc'): assert response.relationship_types == ['relationship_types_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_feed_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_feed), - '__call__') as call: - call.return_value = asset_service.Feed() - client.update_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() - - def test_update_feed_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3099,34 +2809,6 @@ def test_update_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_feed_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_feed), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( - name='name_value', - asset_names=['asset_names_value'], - asset_types=['asset_types_value'], - content_type=asset_service.ContentType.RESOURCE, - relationship_types=['relationship_types_value'], - )) - await client.update_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() - - @pytest.mark.asyncio async def test_update_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3383,26 +3065,6 @@ def test_delete_feed(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_feed_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_feed), - '__call__') as call: - call.return_value = None - client.delete_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() - - def test_delete_feed_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3462,28 +3124,6 @@ def test_delete_feed_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_feed_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_feed), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_feed(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() - - @pytest.mark.asyncio async def test_delete_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3732,26 +3372,6 @@ def test_search_all_resources(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_search_all_resources_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.search_all_resources), - '__call__') as call: - call.return_value = asset_service.SearchAllResourcesResponse() - client.search_all_resources(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() - - def test_search_all_resources_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3817,30 +3437,6 @@ def test_search_all_resources_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_search_all_resources_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.search_all_resources), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllResourcesResponse( - next_page_token='next_page_token_value', - )) - await client.search_all_resources(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() - - @pytest.mark.asyncio async def test_search_all_resources_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4308,26 +3904,6 @@ def test_search_all_iam_policies(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_search_all_iam_policies_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.search_all_iam_policies), - '__call__') as call: - call.return_value = asset_service.SearchAllIamPoliciesResponse() - client.search_all_iam_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() - - def test_search_all_iam_policies_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4393,30 +3969,6 @@ def test_search_all_iam_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_search_all_iam_policies_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.search_all_iam_policies), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllIamPoliciesResponse( - next_page_token='next_page_token_value', - )) - await client.search_all_iam_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() - - @pytest.mark.asyncio async def test_search_all_iam_policies_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4874,26 +4426,6 @@ def test_analyze_iam_policy(request_type, transport: str = 'grpc'): assert response.fully_explored is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_iam_policy_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_iam_policy), - '__call__') as call: - call.return_value = asset_service.AnalyzeIamPolicyResponse() - client.analyze_iam_policy(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() - - def test_analyze_iam_policy_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4953,30 +4485,6 @@ def test_analyze_iam_policy_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_analyze_iam_policy_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_iam_policy), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeIamPolicyResponse( - fully_explored=True, - )) - await client.analyze_iam_policy(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() - - @pytest.mark.asyncio async def test_analyze_iam_policy_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5143,26 +4651,6 @@ def test_analyze_iam_policy_longrunning(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_iam_policy_longrunning_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_iam_policy_longrunning), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.analyze_iam_policy_longrunning(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() - - def test_analyze_iam_policy_longrunning_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5227,30 +4715,6 @@ def test_analyze_iam_policy_longrunning_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_analyze_iam_policy_longrunning_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_iam_policy_longrunning), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.analyze_iam_policy_longrunning(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() - - @pytest.mark.asyncio async def test_analyze_iam_policy_longrunning_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5422,26 +4886,6 @@ def test_analyze_move(request_type, transport: str = 'grpc'): assert isinstance(response, asset_service.AnalyzeMoveResponse) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_move_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_move), - '__call__') as call: - call.return_value = asset_service.AnalyzeMoveResponse() - client.analyze_move(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() - - def test_analyze_move_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5503,29 +4947,6 @@ def test_analyze_move_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_analyze_move_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_move), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeMoveResponse( - )) - await client.analyze_move(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() - - @pytest.mark.asyncio async def test_analyze_move_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5695,26 +5116,6 @@ def test_query_assets(request_type, transport: str = 'grpc'): assert response.done is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_query_assets_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_assets), - '__call__') as call: - call.return_value = asset_service.QueryAssetsResponse() - client.query_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() - - def test_query_assets_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5780,31 +5181,6 @@ def test_query_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_query_assets_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_assets), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.QueryAssetsResponse( - job_reference='job_reference_value', - done=True, - )) - await client.query_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() - - @pytest.mark.asyncio async def test_query_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5982,26 +5358,6 @@ def test_create_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_saved_query_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_saved_query), - '__call__') as call: - call.return_value = asset_service.SavedQuery() - client.create_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() - - def test_create_saved_query_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6063,33 +5419,6 @@ def test_create_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_saved_query_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_saved_query), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( - name='name_value', - description='description_value', - creator='creator_value', - last_updater='last_updater_value', - )) - await client.create_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() - - @pytest.mark.asyncio async def test_create_saved_query_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6373,26 +5702,6 @@ def test_get_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_saved_query_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_saved_query), - '__call__') as call: - call.return_value = asset_service.SavedQuery() - client.get_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() - - def test_get_saved_query_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6452,33 +5761,6 @@ def test_get_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_saved_query_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_saved_query), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( - name='name_value', - description='description_value', - creator='creator_value', - last_updater='last_updater_value', - )) - await client.get_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() - - @pytest.mark.asyncio async def test_get_saved_query_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6736,26 +6018,6 @@ def test_list_saved_queries(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_saved_queries_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_saved_queries), - '__call__') as call: - call.return_value = asset_service.ListSavedQueriesResponse() - client.list_saved_queries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() - - def test_list_saved_queries_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6819,30 +6081,6 @@ def test_list_saved_queries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_saved_queries_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_saved_queries), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListSavedQueriesResponse( - next_page_token='next_page_token_value', - )) - await client.list_saved_queries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() - - @pytest.mark.asyncio async def test_list_saved_queries_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7296,29 +6534,9 @@ def test_update_saved_query(request_type, transport: str = 'grpc'): assert response.last_updater == 'last_updater_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_saved_query_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_saved_query), - '__call__') as call: - call.return_value = asset_service.SavedQuery() - client.update_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() - - -def test_update_saved_query_non_empty_request_with_auto_populated_field(): - # This test is a coverage failsafe to make sure that UUID4 fields are - # automatically populated, according to AIP-4235, with non-empty requests. +def test_update_saved_query_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport='grpc', @@ -7373,33 +6591,6 @@ def test_update_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_saved_query_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_saved_query), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( - name='name_value', - description='description_value', - creator='creator_value', - last_updater='last_updater_value', - )) - await client.update_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() - - @pytest.mark.asyncio async def test_update_saved_query_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7664,26 +6855,6 @@ def test_delete_saved_query(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_saved_query_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_saved_query), - '__call__') as call: - call.return_value = None - client.delete_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() - - def test_delete_saved_query_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7743,28 +6914,6 @@ def test_delete_saved_query_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_saved_query_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_saved_query), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_saved_query(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() - - @pytest.mark.asyncio async def test_delete_saved_query_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -8011,26 +7160,6 @@ def test_batch_get_effective_iam_policies(request_type, transport: str = 'grpc') assert isinstance(response, asset_service.BatchGetEffectiveIamPoliciesResponse) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_batch_get_effective_iam_policies_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.batch_get_effective_iam_policies), - '__call__') as call: - call.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse() - client.batch_get_effective_iam_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() - - def test_batch_get_effective_iam_policies_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -8090,29 +7219,6 @@ def test_batch_get_effective_iam_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_batch_get_effective_iam_policies_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.batch_get_effective_iam_policies), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetEffectiveIamPoliciesResponse( - )) - await client.batch_get_effective_iam_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() - - @pytest.mark.asyncio async def test_batch_get_effective_iam_policies_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -8280,26 +7386,6 @@ def test_analyze_org_policies(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_org_policies_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policies), - '__call__') as call: - call.return_value = asset_service.AnalyzeOrgPoliciesResponse() - client.analyze_org_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() - - def test_analyze_org_policies_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -8365,30 +7451,6 @@ def test_analyze_org_policies_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_analyze_org_policies_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policies), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPoliciesResponse( - next_page_token='next_page_token_value', - )) - await client.analyze_org_policies(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() - - @pytest.mark.asyncio async def test_analyze_org_policies_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -8856,26 +7918,6 @@ def test_analyze_org_policy_governed_containers(request_type, transport: str = ' assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_org_policy_governed_containers_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policy_governed_containers), - '__call__') as call: - call.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse() - client.analyze_org_policy_governed_containers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() - - def test_analyze_org_policy_governed_containers_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -8941,30 +7983,6 @@ def test_analyze_org_policy_governed_containers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_analyze_org_policy_governed_containers_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policy_governed_containers), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedContainersResponse( - next_page_token='next_page_token_value', - )) - await client.analyze_org_policy_governed_containers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() - - @pytest.mark.asyncio async def test_analyze_org_policy_governed_containers_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -9432,26 +8450,6 @@ def test_analyze_org_policy_governed_assets(request_type, transport: str = 'grpc assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_analyze_org_policy_governed_assets_empty_call(): - client = AssetServiceClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policy_governed_assets), - '__call__') as call: - call.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse() - client.analyze_org_policy_governed_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() - - def test_analyze_org_policy_governed_assets_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -9517,39 +8515,15 @@ def test_analyze_org_policy_governed_assets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_analyze_org_policy_governed_assets_empty_call_async(): - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.analyze_org_policy_governed_assets), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedAssetsResponse( - next_page_token='next_page_token_value', - )) - await client.analyze_org_policy_governed_assets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() - - -@pytest.mark.asyncio -async def test_analyze_org_policy_governed_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): - # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, - # instead of constructing them on each call - with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = AssetServiceAsyncClient( - credentials=async_anonymous_credentials(), - transport=transport, - ) +async def test_analyze_org_policy_governed_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) # Should wrap all calls on client creation assert wrapper_fn.call_count > 0 @@ -16458,18 +15432,1438 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" -def test_transport_kind_grpc_asyncio(): - transport = AssetServiceAsyncClient.get_transport_class("grpc_asyncio")( - credentials=async_anonymous_credentials() +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_export_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), ) - assert transport.kind == "grpc_asyncio" + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_assets), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_assets(request=None) -def test_transport_kind_rest(): - transport = AssetServiceClient.get_transport_class("rest")( - credentials=ga_credentials.AnonymousCredentials() + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ExportAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), ) - assert transport.kind == "rest" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_assets), + '__call__') as call: + call.return_value = asset_service.ListAssetsResponse() + client.list_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_batch_get_assets_history_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_assets_history), + '__call__') as call: + call.return_value = asset_service.BatchGetAssetsHistoryResponse() + client.batch_get_assets_history(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.create_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.get_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_feeds_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_feeds), + '__call__') as call: + call.return_value = asset_service.ListFeedsResponse() + client.list_feeds(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListFeedsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.update_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_feed), + '__call__') as call: + call.return_value = None + client.delete_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_search_all_resources_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_resources), + '__call__') as call: + call.return_value = asset_service.SearchAllResourcesResponse() + client.search_all_resources(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllResourcesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_search_all_iam_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_iam_policies), + '__call__') as call: + call.return_value = asset_service.SearchAllIamPoliciesResponse() + client.search_all_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_iam_policy_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy), + '__call__') as call: + call.return_value = asset_service.AnalyzeIamPolicyResponse() + client.analyze_iam_policy(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_iam_policy_longrunning_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy_longrunning), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.analyze_iam_policy_longrunning(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_move_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_move), + '__call__') as call: + call.return_value = asset_service.AnalyzeMoveResponse() + client.analyze_move(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeMoveRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_query_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_assets), + '__call__') as call: + call.return_value = asset_service.QueryAssetsResponse() + client.query_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.QueryAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.create_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.get_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_saved_queries_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_saved_queries), + '__call__') as call: + call.return_value = asset_service.ListSavedQueriesResponse() + client.list_saved_queries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListSavedQueriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.update_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_saved_query), + '__call__') as call: + call.return_value = None + client.delete_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_batch_get_effective_iam_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_effective_iam_policies), + '__call__') as call: + call.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse() + client.batch_get_effective_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policies), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPoliciesResponse() + client.analyze_org_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policy_governed_containers_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_containers), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse() + client.analyze_org_policy_governed_containers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policy_governed_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_assets), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse() + client.analyze_org_policy_governed_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + +def test_transport_kind_grpc_asyncio(): + transport = AssetServiceAsyncClient.get_transport_class("grpc_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "grpc_asyncio" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_export_assets_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_assets), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.export_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ExportAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_assets_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_assets), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListAssetsResponse( + next_page_token='next_page_token_value', + )) + await client.list_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_batch_get_assets_history_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_assets_history), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetAssetsHistoryResponse( + )) + await client.batch_get_assets_history(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_feed_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_feed), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( + name='name_value', + asset_names=['asset_names_value'], + asset_types=['asset_types_value'], + content_type=asset_service.ContentType.RESOURCE, + relationship_types=['relationship_types_value'], + )) + await client.create_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_feed_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_feed), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( + name='name_value', + asset_names=['asset_names_value'], + asset_types=['asset_types_value'], + content_type=asset_service.ContentType.RESOURCE, + relationship_types=['relationship_types_value'], + )) + await client.get_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_feeds_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_feeds), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListFeedsResponse( + )) + await client.list_feeds(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListFeedsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_feed_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_feed), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.Feed( + name='name_value', + asset_names=['asset_names_value'], + asset_types=['asset_types_value'], + content_type=asset_service.ContentType.RESOURCE, + relationship_types=['relationship_types_value'], + )) + await client.update_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_feed_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_feed), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_search_all_resources_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_resources), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllResourcesResponse( + next_page_token='next_page_token_value', + )) + await client.search_all_resources(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllResourcesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_search_all_iam_policies_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_iam_policies), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SearchAllIamPoliciesResponse( + next_page_token='next_page_token_value', + )) + await client.search_all_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_iam_policy_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeIamPolicyResponse( + fully_explored=True, + )) + await client.analyze_iam_policy(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_iam_policy_longrunning_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy_longrunning), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.analyze_iam_policy_longrunning(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_move_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_move), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeMoveResponse( + )) + await client.analyze_move(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeMoveRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_query_assets_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_assets), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.QueryAssetsResponse( + job_reference='job_reference_value', + done=True, + )) + await client.query_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.QueryAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_saved_query_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_saved_query), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( + name='name_value', + description='description_value', + creator='creator_value', + last_updater='last_updater_value', + )) + await client.create_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_saved_query_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_saved_query), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( + name='name_value', + description='description_value', + creator='creator_value', + last_updater='last_updater_value', + )) + await client.get_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_saved_queries_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_saved_queries), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.ListSavedQueriesResponse( + next_page_token='next_page_token_value', + )) + await client.list_saved_queries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListSavedQueriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_saved_query_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_saved_query), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.SavedQuery( + name='name_value', + description='description_value', + creator='creator_value', + last_updater='last_updater_value', + )) + await client.update_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_saved_query_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_saved_query), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_batch_get_effective_iam_policies_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_effective_iam_policies), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.BatchGetEffectiveIamPoliciesResponse( + )) + await client.batch_get_effective_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_org_policies_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policies), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPoliciesResponse( + next_page_token='next_page_token_value', + )) + await client.analyze_org_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_org_policy_governed_containers_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_containers), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedContainersResponse( + next_page_token='next_page_token_value', + )) + await client.analyze_org_policy_governed_containers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_analyze_org_policy_governed_assets_empty_call_async(): + client = AssetServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_assets), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(asset_service.AnalyzeOrgPolicyGovernedAssetsResponse( + next_page_token='next_page_token_value', + )) + await client.analyze_org_policy_governed_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + +def test_transport_kind_rest(): + transport = AssetServiceClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_export_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_assets), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ExportAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_assets), + '__call__') as call: + call.return_value = asset_service.ListAssetsResponse() + client.list_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_batch_get_assets_history_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_assets_history), + '__call__') as call: + call.return_value = asset_service.BatchGetAssetsHistoryResponse() + client.batch_get_assets_history(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.create_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.get_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_feeds_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_feeds), + '__call__') as call: + call.return_value = asset_service.ListFeedsResponse() + client.list_feeds(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListFeedsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_feed), + '__call__') as call: + call.return_value = asset_service.Feed() + client.update_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_feed_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_feed), + '__call__') as call: + call.return_value = None + client.delete_feed(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteFeedRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_search_all_resources_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_resources), + '__call__') as call: + call.return_value = asset_service.SearchAllResourcesResponse() + client.search_all_resources(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllResourcesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_search_all_iam_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.search_all_iam_policies), + '__call__') as call: + call.return_value = asset_service.SearchAllIamPoliciesResponse() + client.search_all_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.SearchAllIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_iam_policy_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy), + '__call__') as call: + call.return_value = asset_service.AnalyzeIamPolicyResponse() + client.analyze_iam_policy(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_iam_policy_longrunning_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_iam_policy_longrunning), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.analyze_iam_policy_longrunning(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_move_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_move), + '__call__') as call: + call.return_value = asset_service.AnalyzeMoveResponse() + client.analyze_move(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeMoveRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_query_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_assets), + '__call__') as call: + call.return_value = asset_service.QueryAssetsResponse() + client.query_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.QueryAssetsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.create_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.CreateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.get_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.GetSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_saved_queries_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_saved_queries), + '__call__') as call: + call.return_value = asset_service.ListSavedQueriesResponse() + client.list_saved_queries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.ListSavedQueriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_saved_query), + '__call__') as call: + call.return_value = asset_service.SavedQuery() + client.update_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.UpdateSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_saved_query_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_saved_query), + '__call__') as call: + call.return_value = None + client.delete_saved_query(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.DeleteSavedQueryRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_batch_get_effective_iam_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_get_effective_iam_policies), + '__call__') as call: + call.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse() + client.batch_get_effective_iam_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policies_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policies), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPoliciesResponse() + client.analyze_org_policies(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policy_governed_containers_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_containers), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse() + client.analyze_org_policy_governed_containers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_analyze_org_policy_governed_assets_empty_call(): + client = AssetServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.analyze_org_policy_governed_assets), + '__call__') as call: + call.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse() + client.analyze_org_policy_governed_assets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() def test_transport_grpc_default(): diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 8e9138e413..25adcdfb41 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -808,26 +808,6 @@ def test_generate_access_token(request_type, transport: str = 'grpc'): assert response.access_token == 'access_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_generate_access_token_empty_call(): - client = IAMCredentialsClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.generate_access_token), - '__call__') as call: - call.return_value = common.GenerateAccessTokenResponse() - client.generate_access_token(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() - - def test_generate_access_token_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -887,30 +867,6 @@ def test_generate_access_token_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_generate_access_token_empty_call_async(): - client = IAMCredentialsAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.generate_access_token), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateAccessTokenResponse( - access_token='access_token_value', - )) - await client.generate_access_token(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() - - @pytest.mark.asyncio async def test_generate_access_token_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1188,26 +1144,6 @@ def test_generate_id_token(request_type, transport: str = 'grpc'): assert response.token == 'token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_generate_id_token_empty_call(): - client = IAMCredentialsClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.generate_id_token), - '__call__') as call: - call.return_value = common.GenerateIdTokenResponse() - client.generate_id_token(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() - - def test_generate_id_token_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1269,30 +1205,6 @@ def test_generate_id_token_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_generate_id_token_empty_call_async(): - client = IAMCredentialsAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.generate_id_token), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateIdTokenResponse( - token='token_value', - )) - await client.generate_id_token(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() - - @pytest.mark.asyncio async def test_generate_id_token_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1576,26 +1488,6 @@ def test_sign_blob(request_type, transport: str = 'grpc'): assert response.signed_blob == b'signed_blob_blob' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_sign_blob_empty_call(): - client = IAMCredentialsClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.sign_blob), - '__call__') as call: - call.return_value = common.SignBlobResponse() - client.sign_blob(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() - - def test_sign_blob_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1655,31 +1547,6 @@ def test_sign_blob_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_sign_blob_empty_call_async(): - client = IAMCredentialsAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.sign_blob), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.SignBlobResponse( - key_id='key_id_value', - signed_blob=b'signed_blob_blob', - )) - await client.sign_blob(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() - - @pytest.mark.asyncio async def test_sign_blob_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1955,26 +1822,6 @@ def test_sign_jwt(request_type, transport: str = 'grpc'): assert response.signed_jwt == 'signed_jwt_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_sign_jwt_empty_call(): - client = IAMCredentialsClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.sign_jwt), - '__call__') as call: - call.return_value = common.SignJwtResponse() - client.sign_jwt(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() - - def test_sign_jwt_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2036,31 +1883,6 @@ def test_sign_jwt_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_sign_jwt_empty_call_async(): - client = IAMCredentialsAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.sign_jwt), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.SignJwtResponse( - key_id='key_id_value', - signed_jwt='signed_jwt_value', - )) - await client.sign_jwt(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() - - @pytest.mark.asyncio async def test_sign_jwt_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3505,6 +3327,83 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_access_token_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_access_token), + '__call__') as call: + call.return_value = common.GenerateAccessTokenResponse() + client.generate_access_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateAccessTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_id_token_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_id_token), + '__call__') as call: + call.return_value = common.GenerateIdTokenResponse() + client.generate_id_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateIdTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_sign_blob_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_blob), + '__call__') as call: + call.return_value = common.SignBlobResponse() + client.sign_blob(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignBlobRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_sign_jwt_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_jwt), + '__call__') as call: + call.return_value = common.SignJwtResponse() + client.sign_jwt(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignJwtRequest() + + def test_transport_kind_grpc_asyncio(): transport = IAMCredentialsAsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -3512,6 +3411,101 @@ def test_transport_kind_grpc_asyncio(): assert transport.kind == "grpc_asyncio" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_generate_access_token_empty_call_async(): + client = IAMCredentialsAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_access_token), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateAccessTokenResponse( + access_token='access_token_value', + )) + await client.generate_access_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateAccessTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_generate_id_token_empty_call_async(): + client = IAMCredentialsAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_id_token), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.GenerateIdTokenResponse( + token='token_value', + )) + await client.generate_id_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateIdTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_sign_blob_empty_call_async(): + client = IAMCredentialsAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_blob), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.SignBlobResponse( + key_id='key_id_value', + signed_blob=b'signed_blob_blob', + )) + await client.sign_blob(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignBlobRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_sign_jwt_empty_call_async(): + client = IAMCredentialsAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_jwt), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(common.SignJwtResponse( + key_id='key_id_value', + signed_jwt='signed_jwt_value', + )) + await client.sign_jwt(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignJwtRequest() + + def test_transport_kind_rest(): transport = IAMCredentialsClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -3519,6 +3513,83 @@ def test_transport_kind_rest(): assert transport.kind == "rest" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_access_token_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_access_token), + '__call__') as call: + call.return_value = common.GenerateAccessTokenResponse() + client.generate_access_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateAccessTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_id_token_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_id_token), + '__call__') as call: + call.return_value = common.GenerateIdTokenResponse() + client.generate_id_token(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.GenerateIdTokenRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_sign_blob_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_blob), + '__call__') as call: + call.return_value = common.SignBlobResponse() + client.sign_blob(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignBlobRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_sign_jwt_empty_call(): + client = IAMCredentialsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.sign_jwt), + '__call__') as call: + call.return_value = common.SignJwtResponse() + client.sign_jwt(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == common.SignJwtRequest() + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = IAMCredentialsClient( diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index 6e6320aac2..bcce38f0d2 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -836,26 +836,6 @@ def test_get_trigger(request_type, transport: str = 'grpc'): assert response.etag == 'etag_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_trigger_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_trigger), - '__call__') as call: - call.return_value = trigger.Trigger() - client.get_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() - - def test_get_trigger_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -915,34 +895,6 @@ def test_get_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_trigger_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_trigger), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(trigger.Trigger( - name='name_value', - uid='uid_value', - service_account='service_account_value', - channel='channel_value', - etag='etag_value', - )) - await client.get_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() - - @pytest.mark.asyncio async def test_get_trigger_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1204,26 +1156,6 @@ def test_list_triggers(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_triggers_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_triggers), - '__call__') as call: - call.return_value = eventarc.ListTriggersResponse() - client.list_triggers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() - - def test_list_triggers_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1289,31 +1221,6 @@ def test_list_triggers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_triggers_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_triggers), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListTriggersResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - await client.list_triggers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() - - @pytest.mark.asyncio async def test_list_triggers_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1760,26 +1667,6 @@ def test_create_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_trigger_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_trigger), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() - - def test_create_trigger_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1846,30 +1733,6 @@ def test_create_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_trigger_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_trigger), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() - - @pytest.mark.asyncio async def test_create_trigger_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2144,26 +2007,6 @@ def test_update_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_trigger_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_trigger), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.update_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() - - def test_update_trigger_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2226,30 +2069,6 @@ def test_update_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_trigger_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_trigger), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.update_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() - - @pytest.mark.asyncio async def test_update_trigger_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2524,26 +2343,6 @@ def test_delete_trigger(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_trigger_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_trigger), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.delete_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() - - def test_delete_trigger_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2610,30 +2409,6 @@ def test_delete_trigger_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_trigger_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_trigger), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.delete_trigger(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() - - @pytest.mark.asyncio async def test_delete_trigger_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2912,26 +2687,6 @@ def test_get_channel(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_channel_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_channel), - '__call__') as call: - call.return_value = channel.Channel() - client.get_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() - - def test_get_channel_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2991,35 +2746,6 @@ def test_get_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_channel_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_channel), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(channel.Channel( - name='name_value', - uid='uid_value', - provider='provider_value', - state=channel.Channel.State.PENDING, - activation_token='activation_token_value', - crypto_key_name='crypto_key_name_value', - )) - await client.get_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() - - @pytest.mark.asyncio async def test_get_channel_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3283,26 +3009,6 @@ def test_list_channels(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_channels_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_channels), - '__call__') as call: - call.return_value = eventarc.ListChannelsResponse() - client.list_channels(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() - - def test_list_channels_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3366,31 +3072,6 @@ def test_list_channels_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_channels_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_channels), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListChannelsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - await client.list_channels(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() - - @pytest.mark.asyncio async def test_list_channels_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3837,26 +3518,6 @@ def test_create_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_channel_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_channel_), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() - - def test_create_channel_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3923,30 +3584,6 @@ def test_create_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_channel_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_channel_), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() - - @pytest.mark.asyncio async def test_create_channel_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4221,26 +3858,6 @@ def test_update_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_channel_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_channel), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.update_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() - - def test_update_channel_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4303,30 +3920,6 @@ def test_update_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_channel_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_channel), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.update_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() - - @pytest.mark.asyncio async def test_update_channel_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4591,26 +4184,6 @@ def test_delete_channel(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_channel_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_channel), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.delete_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() - - def test_delete_channel_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4675,30 +4248,6 @@ def test_delete_channel_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_channel_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_channel), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.delete_channel(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() - - @pytest.mark.asyncio async def test_delete_channel_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4958,26 +4507,6 @@ def test_get_provider(request_type, transport: str = 'grpc'): assert response.display_name == 'display_name_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_provider_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_provider), - '__call__') as call: - call.return_value = discovery.Provider() - client.get_provider(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() - - def test_get_provider_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5037,31 +4566,6 @@ def test_get_provider_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_provider_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_provider), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(discovery.Provider( - name='name_value', - display_name='display_name_value', - )) - await client.get_provider(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() - - @pytest.mark.asyncio async def test_get_provider_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5317,32 +4821,12 @@ def test_list_providers(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_providers_empty_call(): +def test_list_providers_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_providers), - '__call__') as call: - call.return_value = eventarc.ListProvidersResponse() - client.list_providers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() - - -def test_list_providers_non_empty_request_with_auto_populated_field(): - # This test is a coverage failsafe to make sure that UUID4 fields are - # automatically populated, according to AIP-4235, with non-empty requests. - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', + transport='grpc', ) # Populate all string fields in the request which are not UUID4 @@ -5402,31 +4886,6 @@ def test_list_providers_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_providers_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_providers), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListProvidersResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - await client.list_providers(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() - - @pytest.mark.asyncio async def test_list_providers_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5882,26 +5341,6 @@ def test_get_channel_connection(request_type, transport: str = 'grpc'): assert response.activation_token == 'activation_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_channel_connection_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_channel_connection), - '__call__') as call: - call.return_value = channel_connection.ChannelConnection() - client.get_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() - - def test_get_channel_connection_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5961,33 +5400,6 @@ def test_get_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_channel_connection_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_channel_connection), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(channel_connection.ChannelConnection( - name='name_value', - uid='uid_value', - channel='channel_value', - activation_token='activation_token_value', - )) - await client.get_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() - - @pytest.mark.asyncio async def test_get_channel_connection_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6247,26 +5659,6 @@ def test_list_channel_connections(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_channel_connections_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_channel_connections), - '__call__') as call: - call.return_value = eventarc.ListChannelConnectionsResponse() - client.list_channel_connections(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() - - def test_list_channel_connections_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6328,31 +5720,6 @@ def test_list_channel_connections_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_channel_connections_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_channel_connections), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListChannelConnectionsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - await client.list_channel_connections(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() - - @pytest.mark.asyncio async def test_list_channel_connections_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6799,26 +6166,6 @@ def test_create_channel_connection(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_channel_connection_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_channel_connection), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() - - def test_create_channel_connection_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6885,30 +6232,6 @@ def test_create_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_channel_connection_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_channel_connection), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() - - @pytest.mark.asyncio async def test_create_channel_connection_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7183,26 +6506,6 @@ def test_delete_channel_connection(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_channel_connection_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_channel_connection), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.delete_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() - - def test_delete_channel_connection_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7267,30 +6570,6 @@ def test_delete_channel_connection_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_channel_connection_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_channel_connection), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.delete_channel_connection(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() - - @pytest.mark.asyncio async def test_delete_channel_connection_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7550,26 +6829,6 @@ def test_get_google_channel_config(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_google_channel_config_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_google_channel_config), - '__call__') as call: - call.return_value = google_channel_config.GoogleChannelConfig() - client.get_google_channel_config(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() - - def test_get_google_channel_config_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7629,40 +6888,15 @@ def test_get_google_channel_config_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_get_google_channel_config_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_google_channel_config), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(google_channel_config.GoogleChannelConfig( - name='name_value', - crypto_key_name='crypto_key_name_value', - )) - await client.get_google_channel_config(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() - - -@pytest.mark.asyncio -async def test_get_google_channel_config_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): - # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, - # instead of constructing them on each call - with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - transport=transport, - ) +async def test_get_google_channel_config_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) # Should wrap all calls on client creation assert wrapper_fn.call_count > 0 @@ -7909,26 +7143,6 @@ def test_update_google_channel_config(request_type, transport: str = 'grpc'): assert response.crypto_key_name == 'crypto_key_name_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_google_channel_config_empty_call(): - client = EventarcClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_google_channel_config), - '__call__') as call: - call.return_value = gce_google_channel_config.GoogleChannelConfig() - client.update_google_channel_config(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() - - def test_update_google_channel_config_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7986,31 +7200,6 @@ def test_update_google_channel_config_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_google_channel_config_empty_call_async(): - client = EventarcAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_google_channel_config), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(gce_google_channel_config.GoogleChannelConfig( - name='name_value', - crypto_key_name='crypto_key_name_value', - )) - await client.update_google_channel_config(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() - - @pytest.mark.asyncio async def test_update_google_channel_config_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -13880,18 +13069,1138 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" -def test_transport_kind_grpc_asyncio(): - transport = EventarcAsyncClient.get_transport_class("grpc_asyncio")( - credentials=async_anonymous_credentials() +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), ) - assert transport.kind == "grpc_asyncio" + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_trigger), + '__call__') as call: + call.return_value = trigger.Trigger() + client.get_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetTriggerRequest() -def test_transport_kind_rest(): - transport = EventarcClient.get_transport_class("rest")( - credentials=ga_credentials.AnonymousCredentials() +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_triggers_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), ) - assert transport.kind == "rest" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_triggers), + '__call__') as call: + call.return_value = eventarc.ListTriggersResponse() + client.list_triggers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListTriggersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel), + '__call__') as call: + call.return_value = channel.Channel() + client.get_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_channels_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channels), + '__call__') as call: + call.return_value = eventarc.ListChannelsResponse() + client.list_channels(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_channel), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_provider_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_provider), + '__call__') as call: + call.return_value = discovery.Provider() + client.get_provider(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetProviderRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_providers_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_providers), + '__call__') as call: + call.return_value = eventarc.ListProvidersResponse() + client.list_providers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListProvidersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel_connection), + '__call__') as call: + call.return_value = channel_connection.ChannelConnection() + client.get_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_channel_connections_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channel_connections), + '__call__') as call: + call.return_value = eventarc.ListChannelConnectionsResponse() + client.list_channel_connections(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelConnectionsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_connection), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel_connection), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_google_channel_config_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_google_channel_config), + '__call__') as call: + call.return_value = google_channel_config.GoogleChannelConfig() + client.get_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetGoogleChannelConfigRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_google_channel_config_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_google_channel_config), + '__call__') as call: + call.return_value = gce_google_channel_config.GoogleChannelConfig() + client.update_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + + +def test_transport_kind_grpc_asyncio(): + transport = EventarcAsyncClient.get_transport_class("grpc_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "grpc_asyncio" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_trigger_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_trigger), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(trigger.Trigger( + name='name_value', + uid='uid_value', + service_account='service_account_value', + channel='channel_value', + etag='etag_value', + )) + await client.get_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_triggers_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_triggers), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListTriggersResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_triggers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListTriggersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_trigger_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_trigger), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_trigger_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_trigger), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.update_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_trigger_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_trigger), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_channel_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(channel.Channel( + name='name_value', + uid='uid_value', + provider='provider_value', + state=channel.Channel.State.PENDING, + activation_token='activation_token_value', + crypto_key_name='crypto_key_name_value', + )) + await client.get_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_channels_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channels), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListChannelsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_channels(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_channel_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_channel_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_channel), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.update_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_channel_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_provider_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_provider), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(discovery.Provider( + name='name_value', + display_name='display_name_value', + )) + await client.get_provider(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetProviderRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_providers_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_providers), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListProvidersResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_providers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListProvidersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_channel_connection_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel_connection), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(channel_connection.ChannelConnection( + name='name_value', + uid='uid_value', + channel='channel_value', + activation_token='activation_token_value', + )) + await client.get_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_channel_connections_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channel_connections), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(eventarc.ListChannelConnectionsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_channel_connections(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelConnectionsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_channel_connection_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_connection), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_channel_connection_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel_connection), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_google_channel_config_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_google_channel_config), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(google_channel_config.GoogleChannelConfig( + name='name_value', + crypto_key_name='crypto_key_name_value', + )) + await client.get_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetGoogleChannelConfigRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_google_channel_config_empty_call_async(): + client = EventarcAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_google_channel_config), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(gce_google_channel_config.GoogleChannelConfig( + name='name_value', + crypto_key_name='crypto_key_name_value', + )) + await client.update_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + + +def test_transport_kind_rest(): + transport = EventarcClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_trigger), + '__call__') as call: + call.return_value = trigger.Trigger() + client.get_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_triggers_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_triggers), + '__call__') as call: + call.return_value = eventarc.ListTriggersResponse() + client.list_triggers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListTriggersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_trigger_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_trigger), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_trigger(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteTriggerRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel), + '__call__') as call: + call.return_value = channel.Channel() + client.get_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_channels_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channels), + '__call__') as call: + call.return_value = eventarc.ListChannelsResponse() + client.list_channels(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_channel), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_channel_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_provider_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_provider), + '__call__') as call: + call.return_value = discovery.Provider() + client.get_provider(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetProviderRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_providers_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_providers), + '__call__') as call: + call.return_value = eventarc.ListProvidersResponse() + client.list_providers(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListProvidersRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_channel_connection), + '__call__') as call: + call.return_value = channel_connection.ChannelConnection() + client.get_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_channel_connections_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_channel_connections), + '__call__') as call: + call.return_value = eventarc.ListChannelConnectionsResponse() + client.list_channel_connections(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.ListChannelConnectionsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_channel_connection), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.CreateChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_channel_connection_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_channel_connection), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_channel_connection(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.DeleteChannelConnectionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_google_channel_config_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_google_channel_config), + '__call__') as call: + call.return_value = google_channel_config.GoogleChannelConfig() + client.get_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.GetGoogleChannelConfigRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_google_channel_config_empty_call(): + client = EventarcClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_google_channel_config), + '__call__') as call: + call.return_value = gce_google_channel_config.GoogleChannelConfig() + client.update_google_channel_config(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index b97cca5c4d..cc9aa5c883 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -795,26 +795,6 @@ def test_list_buckets(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_buckets_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_buckets), - '__call__') as call: - call.return_value = logging_config.ListBucketsResponse() - client.list_buckets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() - - def test_list_buckets_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -876,30 +856,6 @@ def test_list_buckets_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_buckets_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_buckets), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListBucketsResponse( - next_page_token='next_page_token_value', - )) - await client.list_buckets(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() - - @pytest.mark.asyncio async def test_list_buckets_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1359,26 +1315,6 @@ def test_get_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_bucket_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_bucket), - '__call__') as call: - call.return_value = logging_config.LogBucket() - client.get_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() - - def test_get_bucket_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1438,36 +1374,6 @@ def test_get_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_bucket_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_bucket), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( - name='name_value', - description='description_value', - retention_days=1512, - locked=True, - lifecycle_state=logging_config.LifecycleState.ACTIVE, - analytics_enabled=True, - restricted_fields=['restricted_fields_value'], - )) - await client.get_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() - - @pytest.mark.asyncio async def test_get_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1646,26 +1552,6 @@ def test_create_bucket_async(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_bucket_async_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_bucket_async), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_bucket_async(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() - - def test_create_bucket_async_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1732,30 +1618,6 @@ def test_create_bucket_async_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_bucket_async_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_bucket_async), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_bucket_async(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() - - @pytest.mark.asyncio async def test_create_bucket_async_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1926,26 +1788,6 @@ def test_update_bucket_async(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_bucket_async_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_bucket_async), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.update_bucket_async(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() - - def test_update_bucket_async_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2010,30 +1852,6 @@ def test_update_bucket_async_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_bucket_async_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_bucket_async), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.update_bucket_async(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() - - @pytest.mark.asyncio async def test_update_bucket_async_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2219,26 +2037,6 @@ def test_create_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_bucket_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_bucket), - '__call__') as call: - call.return_value = logging_config.LogBucket() - client.create_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() - - def test_create_bucket_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2300,36 +2098,6 @@ def test_create_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_bucket_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_bucket), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( - name='name_value', - description='description_value', - retention_days=1512, - locked=True, - lifecycle_state=logging_config.LifecycleState.ACTIVE, - analytics_enabled=True, - restricted_fields=['restricted_fields_value'], - )) - await client.create_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() - - @pytest.mark.asyncio async def test_create_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2523,26 +2291,6 @@ def test_update_bucket(request_type, transport: str = 'grpc'): assert response.restricted_fields == ['restricted_fields_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_bucket_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_bucket), - '__call__') as call: - call.return_value = logging_config.LogBucket() - client.update_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() - - def test_update_bucket_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2602,36 +2350,6 @@ def test_update_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_bucket_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_bucket), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( - name='name_value', - description='description_value', - retention_days=1512, - locked=True, - lifecycle_state=logging_config.LifecycleState.ACTIVE, - analytics_enabled=True, - restricted_fields=['restricted_fields_value'], - )) - await client.update_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() - - @pytest.mark.asyncio async def test_update_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2810,26 +2528,6 @@ def test_delete_bucket(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_bucket_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_bucket), - '__call__') as call: - call.return_value = None - client.delete_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() - - def test_delete_bucket_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2889,28 +2587,6 @@ def test_delete_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_bucket_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_bucket), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() - - @pytest.mark.asyncio async def test_delete_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3074,26 +2750,6 @@ def test_undelete_bucket(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_undelete_bucket_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.undelete_bucket), - '__call__') as call: - call.return_value = None - client.undelete_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() - - def test_undelete_bucket_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3153,28 +2809,6 @@ def test_undelete_bucket_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_undelete_bucket_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.undelete_bucket), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.undelete_bucket(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() - - @pytest.mark.asyncio async def test_undelete_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3341,26 +2975,6 @@ def test_list_views(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_views_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_views), - '__call__') as call: - call.return_value = logging_config.ListViewsResponse() - client.list_views(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() - - def test_list_views_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3422,30 +3036,6 @@ def test_list_views_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_views_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_views), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListViewsResponse( - next_page_token='next_page_token_value', - )) - await client.list_views(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() - - @pytest.mark.asyncio async def test_list_views_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3897,26 +3487,6 @@ def test_get_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_view_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_view), - '__call__') as call: - call.return_value = logging_config.LogView() - client.get_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() - - def test_get_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3976,32 +3546,6 @@ def test_get_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_view_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_view), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( - name='name_value', - description='description_value', - filter='filter_value', - )) - await client.get_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() - - @pytest.mark.asyncio async def test_get_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4179,26 +3723,6 @@ def test_create_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_view_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_view), - '__call__') as call: - call.return_value = logging_config.LogView() - client.create_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() - - def test_create_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4260,32 +3784,6 @@ def test_create_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_view_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_view), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( - name='name_value', - description='description_value', - filter='filter_value', - )) - await client.create_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() - - @pytest.mark.asyncio async def test_create_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4463,32 +3961,12 @@ def test_update_view(request_type, transport: str = 'grpc'): assert response.filter == 'filter_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_view_empty_call(): +def test_update_view_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_view), - '__call__') as call: - call.return_value = logging_config.LogView() - client.update_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() - - -def test_update_view_non_empty_request_with_auto_populated_field(): - # This test is a coverage failsafe to make sure that UUID4 fields are - # automatically populated, according to AIP-4235, with non-empty requests. - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', + transport='grpc', ) # Populate all string fields in the request which are not UUID4 @@ -4542,32 +4020,6 @@ def test_update_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_view_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_view), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( - name='name_value', - description='description_value', - filter='filter_value', - )) - await client.update_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() - - @pytest.mark.asyncio async def test_update_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4738,26 +4190,6 @@ def test_delete_view(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_view_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_view), - '__call__') as call: - call.return_value = None - client.delete_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() - - def test_delete_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4817,28 +4249,6 @@ def test_delete_view_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_view_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_view), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_view(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() - - @pytest.mark.asyncio async def test_delete_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5005,26 +4415,6 @@ def test_list_sinks(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_sinks_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_sinks), - '__call__') as call: - call.return_value = logging_config.ListSinksResponse() - client.list_sinks(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() - - def test_list_sinks_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5086,30 +4476,6 @@ def test_list_sinks_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_sinks_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_sinks), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListSinksResponse( - next_page_token='next_page_token_value', - )) - await client.list_sinks(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() - - @pytest.mark.asyncio async def test_list_sinks_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5571,26 +4937,6 @@ def test_get_sink(request_type, transport: str = 'grpc'): assert response.include_children is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_sink_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_sink), - '__call__') as call: - call.return_value = logging_config.LogSink() - client.get_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() - - def test_get_sink_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -5650,37 +4996,6 @@ def test_get_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_sink_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_sink), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( - name='name_value', - destination='destination_value', - filter='filter_value', - description='description_value', - disabled=True, - output_version_format=logging_config.LogSink.VersionFormat.V2, - writer_identity='writer_identity_value', - include_children=True, - )) - await client.get_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() - - @pytest.mark.asyncio async def test_get_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -5960,26 +5275,6 @@ def test_create_sink(request_type, transport: str = 'grpc'): assert response.include_children is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_sink_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_sink), - '__call__') as call: - call.return_value = logging_config.LogSink() - client.create_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() - - def test_create_sink_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6039,37 +5334,6 @@ def test_create_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_sink_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_sink), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( - name='name_value', - destination='destination_value', - filter='filter_value', - description='description_value', - disabled=True, - output_version_format=logging_config.LogSink.VersionFormat.V2, - writer_identity='writer_identity_value', - include_children=True, - )) - await client.create_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() - - @pytest.mark.asyncio async def test_create_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6359,26 +5623,6 @@ def test_update_sink(request_type, transport: str = 'grpc'): assert response.include_children is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_sink_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_sink), - '__call__') as call: - call.return_value = logging_config.LogSink() - client.update_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() - - def test_update_sink_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6438,37 +5682,6 @@ def test_update_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_sink_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_sink), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( - name='name_value', - destination='destination_value', - filter='filter_value', - description='description_value', - disabled=True, - output_version_format=logging_config.LogSink.VersionFormat.V2, - writer_identity='writer_identity_value', - include_children=True, - )) - await client.update_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() - - @pytest.mark.asyncio async def test_update_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -6751,26 +5964,6 @@ def test_delete_sink(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_sink_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_sink), - '__call__') as call: - call.return_value = None - client.delete_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() - - def test_delete_sink_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -6830,28 +6023,6 @@ def test_delete_sink_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_sink_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_sink), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_sink(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() - - @pytest.mark.asyncio async def test_delete_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7097,26 +6268,6 @@ def test_create_link(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_link_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_link), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() - - def test_create_link_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7183,30 +6334,6 @@ def test_create_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_link_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_link), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() - - @pytest.mark.asyncio async def test_create_link_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7481,26 +6608,6 @@ def test_delete_link(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_link_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_link), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.delete_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() - - def test_delete_link_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7565,30 +6672,6 @@ def test_delete_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_link_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_link), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.delete_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() - - @pytest.mark.asyncio async def test_delete_link_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -7846,26 +6929,6 @@ def test_list_links(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_links_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_links), - '__call__') as call: - call.return_value = logging_config.ListLinksResponse() - client.list_links(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() - - def test_list_links_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -7927,30 +6990,6 @@ def test_list_links_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_links_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_links), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListLinksResponse( - next_page_token='next_page_token_value', - )) - await client.list_links(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() - - @pytest.mark.asyncio async def test_list_links_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -8402,26 +7441,6 @@ def test_get_link(request_type, transport: str = 'grpc'): assert response.lifecycle_state == logging_config.LifecycleState.ACTIVE -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_link_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_link), - '__call__') as call: - call.return_value = logging_config.Link() - client.get_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() - - def test_get_link_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -8481,32 +7500,6 @@ def test_get_link_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_link_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_link), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Link( - name='name_value', - description='description_value', - lifecycle_state=logging_config.LifecycleState.ACTIVE, - )) - await client.get_link(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() - - @pytest.mark.asyncio async def test_get_link_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -8762,32 +7755,12 @@ def test_list_exclusions(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_exclusions_empty_call(): +def test_list_exclusions_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_exclusions), - '__call__') as call: - call.return_value = logging_config.ListExclusionsResponse() - client.list_exclusions(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() - - -def test_list_exclusions_non_empty_request_with_auto_populated_field(): - # This test is a coverage failsafe to make sure that UUID4 fields are - # automatically populated, according to AIP-4235, with non-empty requests. - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', + transport='grpc', ) # Populate all string fields in the request which are not UUID4 @@ -8843,30 +7816,6 @@ def test_list_exclusions_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_exclusions_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_exclusions), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListExclusionsResponse( - next_page_token='next_page_token_value', - )) - await client.list_exclusions(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() - - @pytest.mark.asyncio async def test_list_exclusions_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -9320,26 +8269,6 @@ def test_get_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_exclusion_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_exclusion), - '__call__') as call: - call.return_value = logging_config.LogExclusion() - client.get_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() - - def test_get_exclusion_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -9399,33 +8328,6 @@ def test_get_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_exclusion_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_exclusion), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( - name='name_value', - description='description_value', - filter='filter_value', - disabled=True, - )) - await client.get_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() - - @pytest.mark.asyncio async def test_get_exclusion_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -9689,26 +8591,6 @@ def test_create_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_exclusion_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_exclusion), - '__call__') as call: - call.return_value = logging_config.LogExclusion() - client.create_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() - - def test_create_exclusion_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -9768,33 +8650,6 @@ def test_create_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_exclusion_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_exclusion), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( - name='name_value', - description='description_value', - filter='filter_value', - disabled=True, - )) - await client.create_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() - - @pytest.mark.asyncio async def test_create_exclusion_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -10068,26 +8923,6 @@ def test_update_exclusion(request_type, transport: str = 'grpc'): assert response.disabled is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_exclusion_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_exclusion), - '__call__') as call: - call.return_value = logging_config.LogExclusion() - client.update_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() - - def test_update_exclusion_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -10147,33 +8982,6 @@ def test_update_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_exclusion_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_exclusion), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( - name='name_value', - description='description_value', - filter='filter_value', - disabled=True, - )) - await client.update_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() - - @pytest.mark.asyncio async def test_update_exclusion_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -10448,26 +9256,6 @@ def test_delete_exclusion(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_exclusion_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_exclusion), - '__call__') as call: - call.return_value = None - client.delete_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() - - def test_delete_exclusion_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -10527,28 +9315,6 @@ def test_delete_exclusion_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_exclusion_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_exclusion), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_exclusion(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() - - @pytest.mark.asyncio async def test_delete_exclusion_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -10803,26 +9569,6 @@ def test_get_cmek_settings(request_type, transport: str = 'grpc'): assert response.service_account_id == 'service_account_id_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_cmek_settings_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_cmek_settings), - '__call__') as call: - call.return_value = logging_config.CmekSettings() - client.get_cmek_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() - - def test_get_cmek_settings_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -10882,33 +9628,6 @@ def test_get_cmek_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_cmek_settings_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_cmek_settings), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.CmekSettings( - name='name_value', - kms_key_name='kms_key_name_value', - kms_key_version_name='kms_key_version_name_value', - service_account_id='service_account_id_value', - )) - await client.get_cmek_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() - - @pytest.mark.asyncio async def test_get_cmek_settings_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -11090,26 +9809,6 @@ def test_update_cmek_settings(request_type, transport: str = 'grpc'): assert response.service_account_id == 'service_account_id_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_cmek_settings_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_cmek_settings), - '__call__') as call: - call.return_value = logging_config.CmekSettings() - client.update_cmek_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() - - def test_update_cmek_settings_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -11169,33 +9868,6 @@ def test_update_cmek_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_cmek_settings_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_cmek_settings), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.CmekSettings( - name='name_value', - kms_key_name='kms_key_name_value', - kms_key_version_name='kms_key_version_name_value', - service_account_id='service_account_id_value', - )) - await client.update_cmek_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() - - @pytest.mark.asyncio async def test_update_cmek_settings_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -11379,26 +10051,6 @@ def test_get_settings(request_type, transport: str = 'grpc'): assert response.disable_default_sink is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_settings_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_settings), - '__call__') as call: - call.return_value = logging_config.Settings() - client.get_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() - - def test_get_settings_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -11458,34 +10110,6 @@ def test_get_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_settings_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_settings), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Settings( - name='name_value', - kms_key_name='kms_key_name_value', - kms_service_account_id='kms_service_account_id_value', - storage_location='storage_location_value', - disable_default_sink=True, - )) - await client.get_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() - - @pytest.mark.asyncio async def test_get_settings_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -11753,26 +10377,6 @@ def test_update_settings(request_type, transport: str = 'grpc'): assert response.disable_default_sink is True -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_settings_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_settings), - '__call__') as call: - call.return_value = logging_config.Settings() - client.update_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() - - def test_update_settings_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -11832,34 +10436,6 @@ def test_update_settings_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_settings_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_settings), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Settings( - name='name_value', - kms_key_name='kms_key_name_value', - kms_service_account_id='kms_service_account_id_value', - storage_location='storage_location_value', - disable_default_sink=True, - )) - await client.update_settings(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() - - @pytest.mark.asyncio async def test_update_settings_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -12126,26 +10702,6 @@ def test_copy_log_entries(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_copy_log_entries_empty_call(): - client = ConfigServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.copy_log_entries), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.copy_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() - - def test_copy_log_entries_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -12214,30 +10770,6 @@ def test_copy_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_copy_log_entries_empty_call_async(): - client = ConfigServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.copy_log_entries), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.copy_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() - - @pytest.mark.asyncio async def test_copy_log_entries_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -12406,11 +10938,1417 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" -def test_transport_kind_grpc_asyncio(): - transport = ConfigServiceV2AsyncClient.get_transport_class("grpc_asyncio")( - credentials=async_anonymous_credentials() +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_buckets_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), ) - assert transport.kind == "grpc_asyncio" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_buckets), + '__call__') as call: + call.return_value = logging_config.ListBucketsResponse() + client.list_buckets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListBucketsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_bucket_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_bucket), + '__call__') as call: + call.return_value = logging_config.LogBucket() + client.get_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_bucket_async_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_bucket_async), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_bucket_async_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_bucket_async), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_bucket_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_bucket), + '__call__') as call: + call.return_value = logging_config.LogBucket() + client.create_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_bucket_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_bucket), + '__call__') as call: + call.return_value = logging_config.LogBucket() + client.update_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_bucket_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_bucket), + '__call__') as call: + call.return_value = None + client.delete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_undelete_bucket_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undelete_bucket), + '__call__') as call: + call.return_value = None + client.undelete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UndeleteBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_views_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_views), + '__call__') as call: + call.return_value = logging_config.ListViewsResponse() + client.list_views(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListViewsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_view_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_view), + '__call__') as call: + call.return_value = logging_config.LogView() + client.get_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_view_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_view), + '__call__') as call: + call.return_value = logging_config.LogView() + client.create_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_view_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_view), + '__call__') as call: + call.return_value = logging_config.LogView() + client.update_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_view_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_view), + '__call__') as call: + call.return_value = None + client.delete_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_sinks_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_sinks), + '__call__') as call: + call.return_value = logging_config.ListSinksResponse() + client.list_sinks(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListSinksRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_sink_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_sink), + '__call__') as call: + call.return_value = logging_config.LogSink() + client.get_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_sink_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_sink), + '__call__') as call: + call.return_value = logging_config.LogSink() + client.create_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_sink_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_sink), + '__call__') as call: + call.return_value = logging_config.LogSink() + client.update_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_sink_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_sink), + '__call__') as call: + call.return_value = None + client.delete_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_link_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_link), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_link_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_link), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_links_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_links), + '__call__') as call: + call.return_value = logging_config.ListLinksResponse() + client.list_links(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListLinksRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_link_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_link), + '__call__') as call: + call.return_value = logging_config.Link() + client.get_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_exclusions_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_exclusions), + '__call__') as call: + call.return_value = logging_config.ListExclusionsResponse() + client.list_exclusions(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListExclusionsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_exclusion_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_exclusion), + '__call__') as call: + call.return_value = logging_config.LogExclusion() + client.get_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_exclusion_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_exclusion), + '__call__') as call: + call.return_value = logging_config.LogExclusion() + client.create_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_exclusion_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_exclusion), + '__call__') as call: + call.return_value = logging_config.LogExclusion() + client.update_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_exclusion_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_exclusion), + '__call__') as call: + call.return_value = None + client.delete_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_cmek_settings_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_cmek_settings), + '__call__') as call: + call.return_value = logging_config.CmekSettings() + client.get_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetCmekSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_cmek_settings_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_cmek_settings), + '__call__') as call: + call.return_value = logging_config.CmekSettings() + client.update_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateCmekSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_settings_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_settings), + '__call__') as call: + call.return_value = logging_config.Settings() + client.get_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_settings_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_settings), + '__call__') as call: + call.return_value = logging_config.Settings() + client.update_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_copy_log_entries_empty_call(): + client = ConfigServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.copy_log_entries), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.copy_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CopyLogEntriesRequest() + + +def test_transport_kind_grpc_asyncio(): + transport = ConfigServiceV2AsyncClient.get_transport_class("grpc_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "grpc_asyncio" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_buckets_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_buckets), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListBucketsResponse( + next_page_token='next_page_token_value', + )) + await client.list_buckets(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListBucketsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_bucket_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_bucket), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( + name='name_value', + description='description_value', + retention_days=1512, + locked=True, + lifecycle_state=logging_config.LifecycleState.ACTIVE, + analytics_enabled=True, + restricted_fields=['restricted_fields_value'], + )) + await client.get_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_bucket_async_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_bucket_async), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_bucket_async_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_bucket_async), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.update_bucket_async(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_bucket_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_bucket), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( + name='name_value', + description='description_value', + retention_days=1512, + locked=True, + lifecycle_state=logging_config.LifecycleState.ACTIVE, + analytics_enabled=True, + restricted_fields=['restricted_fields_value'], + )) + await client.create_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_bucket_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_bucket), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogBucket( + name='name_value', + description='description_value', + retention_days=1512, + locked=True, + lifecycle_state=logging_config.LifecycleState.ACTIVE, + analytics_enabled=True, + restricted_fields=['restricted_fields_value'], + )) + await client.update_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_bucket_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_bucket), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_undelete_bucket_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undelete_bucket), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.undelete_bucket(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UndeleteBucketRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_views_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_views), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListViewsResponse( + next_page_token='next_page_token_value', + )) + await client.list_views(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListViewsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_view_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_view), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( + name='name_value', + description='description_value', + filter='filter_value', + )) + await client.get_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_view_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_view), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( + name='name_value', + description='description_value', + filter='filter_value', + )) + await client.create_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_view_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_view), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogView( + name='name_value', + description='description_value', + filter='filter_value', + )) + await client.update_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_view_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_view), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_view(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteViewRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_sinks_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_sinks), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListSinksResponse( + next_page_token='next_page_token_value', + )) + await client.list_sinks(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListSinksRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_sink_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_sink), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( + name='name_value', + destination='destination_value', + filter='filter_value', + description='description_value', + disabled=True, + output_version_format=logging_config.LogSink.VersionFormat.V2, + writer_identity='writer_identity_value', + include_children=True, + )) + await client.get_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_sink_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_sink), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( + name='name_value', + destination='destination_value', + filter='filter_value', + description='description_value', + disabled=True, + output_version_format=logging_config.LogSink.VersionFormat.V2, + writer_identity='writer_identity_value', + include_children=True, + )) + await client.create_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_sink_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_sink), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogSink( + name='name_value', + destination='destination_value', + filter='filter_value', + description='description_value', + disabled=True, + output_version_format=logging_config.LogSink.VersionFormat.V2, + writer_identity='writer_identity_value', + include_children=True, + )) + await client.update_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_sink_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_sink), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_sink(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteSinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_link_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_link), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_link_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_link), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_links_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_links), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListLinksResponse( + next_page_token='next_page_token_value', + )) + await client.list_links(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListLinksRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_link_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_link), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Link( + name='name_value', + description='description_value', + lifecycle_state=logging_config.LifecycleState.ACTIVE, + )) + await client.get_link(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetLinkRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_exclusions_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_exclusions), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.ListExclusionsResponse( + next_page_token='next_page_token_value', + )) + await client.list_exclusions(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.ListExclusionsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_exclusion_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_exclusion), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( + name='name_value', + description='description_value', + filter='filter_value', + disabled=True, + )) + await client.get_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_exclusion_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_exclusion), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( + name='name_value', + description='description_value', + filter='filter_value', + disabled=True, + )) + await client.create_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CreateExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_exclusion_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_exclusion), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.LogExclusion( + name='name_value', + description='description_value', + filter='filter_value', + disabled=True, + )) + await client.update_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_exclusion_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_exclusion), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_exclusion(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.DeleteExclusionRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_cmek_settings_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_cmek_settings), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.CmekSettings( + name='name_value', + kms_key_name='kms_key_name_value', + kms_key_version_name='kms_key_version_name_value', + service_account_id='service_account_id_value', + )) + await client.get_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetCmekSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_cmek_settings_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_cmek_settings), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.CmekSettings( + name='name_value', + kms_key_name='kms_key_name_value', + kms_key_version_name='kms_key_version_name_value', + service_account_id='service_account_id_value', + )) + await client.update_cmek_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateCmekSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_settings_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_settings), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Settings( + name='name_value', + kms_key_name='kms_key_name_value', + kms_service_account_id='kms_service_account_id_value', + storage_location='storage_location_value', + disable_default_sink=True, + )) + await client.get_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.GetSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_settings_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_settings), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_config.Settings( + name='name_value', + kms_key_name='kms_key_name_value', + kms_service_account_id='kms_service_account_id_value', + storage_location='storage_location_value', + disable_default_sink=True, + )) + await client.update_settings(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.UpdateSettingsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_copy_log_entries_empty_call_async(): + client = ConfigServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.copy_log_entries), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.copy_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_config.CopyLogEntriesRequest() def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 94f26f27f1..488d153e70 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -794,26 +794,6 @@ def test_delete_log(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_log_empty_call(): - client = LoggingServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_log), - '__call__') as call: - call.return_value = None - client.delete_log(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() - - def test_delete_log_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -873,28 +853,6 @@ def test_delete_log_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_log_empty_call_async(): - client = LoggingServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_log), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_log(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() - - @pytest.mark.asyncio async def test_delete_log_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1141,26 +1099,6 @@ def test_write_log_entries(request_type, transport: str = 'grpc'): assert isinstance(response, logging.WriteLogEntriesResponse) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_write_log_entries_empty_call(): - client = LoggingServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_log_entries), - '__call__') as call: - call.return_value = logging.WriteLogEntriesResponse() - client.write_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() - - def test_write_log_entries_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1220,29 +1158,6 @@ def test_write_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_write_log_entries_empty_call_async(): - client = LoggingServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_log_entries), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.WriteLogEntriesResponse( - )) - await client.write_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() - - @pytest.mark.asyncio async def test_write_log_entries_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1459,26 +1374,6 @@ def test_list_log_entries(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_log_entries_empty_call(): - client = LoggingServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_log_entries), - '__call__') as call: - call.return_value = logging.ListLogEntriesResponse() - client.list_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() - - def test_list_log_entries_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1542,30 +1437,6 @@ def test_list_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_log_entries_empty_call_async(): - client = LoggingServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_log_entries), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListLogEntriesResponse( - next_page_token='next_page_token_value', - )) - await client.list_log_entries(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() - - @pytest.mark.asyncio async def test_list_log_entries_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1965,26 +1836,6 @@ def test_list_monitored_resource_descriptors(request_type, transport: str = 'grp assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_monitored_resource_descriptors_empty_call(): - client = LoggingServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_monitored_resource_descriptors), - '__call__') as call: - call.return_value = logging.ListMonitoredResourceDescriptorsResponse() - client.list_monitored_resource_descriptors(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() - - def test_list_monitored_resource_descriptors_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2044,30 +1895,6 @@ def test_list_monitored_resource_descriptors_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_monitored_resource_descriptors_empty_call_async(): - client = LoggingServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_monitored_resource_descriptors), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListMonitoredResourceDescriptorsResponse( - next_page_token='next_page_token_value', - )) - await client.list_monitored_resource_descriptors(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() - - @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2367,26 +2194,6 @@ def test_list_logs(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_logs_empty_call(): - client = LoggingServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_logs), - '__call__') as call: - call.return_value = logging.ListLogsResponse() - client.list_logs(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() - - def test_list_logs_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2448,31 +2255,6 @@ def test_list_logs_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_logs_empty_call_async(): - client = LoggingServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_logs), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListLogsResponse( - log_names=['log_names_value'], - next_page_token='next_page_token_value', - )) - await client.list_logs(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() - - @pytest.mark.asyncio async def test_list_logs_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2952,7 +2734,6 @@ def test_tail_log_entries_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 - @pytest.mark.asyncio async def test_tail_log_entries_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3116,6 +2897,102 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_log_empty_call(): + client = LoggingServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_log), + '__call__') as call: + call.return_value = None + client.delete_log(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.DeleteLogRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_write_log_entries_empty_call(): + client = LoggingServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_log_entries), + '__call__') as call: + call.return_value = logging.WriteLogEntriesResponse() + client.write_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.WriteLogEntriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_log_entries_empty_call(): + client = LoggingServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_log_entries), + '__call__') as call: + call.return_value = logging.ListLogEntriesResponse() + client.list_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListLogEntriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_monitored_resource_descriptors_empty_call(): + client = LoggingServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_monitored_resource_descriptors), + '__call__') as call: + call.return_value = logging.ListMonitoredResourceDescriptorsResponse() + client.list_monitored_resource_descriptors(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_logs_empty_call(): + client = LoggingServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_logs), + '__call__') as call: + call.return_value = logging.ListLogsResponse() + client.list_logs(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListLogsRequest() + + def test_transport_kind_grpc_asyncio(): transport = LoggingServiceV2AsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -3123,6 +3000,120 @@ def test_transport_kind_grpc_asyncio(): assert transport.kind == "grpc_asyncio" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_log_empty_call_async(): + client = LoggingServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_log), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_log(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.DeleteLogRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_write_log_entries_empty_call_async(): + client = LoggingServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_log_entries), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.WriteLogEntriesResponse( + )) + await client.write_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.WriteLogEntriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_log_entries_empty_call_async(): + client = LoggingServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_log_entries), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListLogEntriesResponse( + next_page_token='next_page_token_value', + )) + await client.list_log_entries(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListLogEntriesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_monitored_resource_descriptors_empty_call_async(): + client = LoggingServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_monitored_resource_descriptors), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListMonitoredResourceDescriptorsResponse( + next_page_token='next_page_token_value', + )) + await client.list_monitored_resource_descriptors(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_logs_empty_call_async(): + client = LoggingServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_logs), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging.ListLogsResponse( + log_names=['log_names_value'], + next_page_token='next_page_token_value', + )) + await client.list_logs(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging.ListLogsRequest() + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = LoggingServiceV2Client( diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index 0f82af3559..a23798d3b2 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -795,26 +795,6 @@ def test_list_log_metrics(request_type, transport: str = 'grpc'): assert response.next_page_token == 'next_page_token_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_log_metrics_empty_call(): - client = MetricsServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_log_metrics), - '__call__') as call: - call.return_value = logging_metrics.ListLogMetricsResponse() - client.list_log_metrics(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() - - def test_list_log_metrics_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -876,30 +856,6 @@ def test_list_log_metrics_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_log_metrics_empty_call_async(): - client = MetricsServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_log_metrics), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.ListLogMetricsResponse( - next_page_token='next_page_token_value', - )) - await client.list_log_metrics(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() - - @pytest.mark.asyncio async def test_list_log_metrics_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1359,26 +1315,6 @@ def test_get_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_log_metric_empty_call(): - client = MetricsServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_log_metric), - '__call__') as call: - call.return_value = logging_metrics.LogMetric() - client.get_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() - - def test_get_log_metric_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1438,36 +1374,6 @@ def test_get_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_log_metric_empty_call_async(): - client = MetricsServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_log_metric), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( - name='name_value', - description='description_value', - filter='filter_value', - bucket_name='bucket_name_value', - disabled=True, - value_extractor='value_extractor_value', - version=logging_metrics.LogMetric.ApiVersion.V1, - )) - await client.get_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() - - @pytest.mark.asyncio async def test_get_log_metric_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1743,26 +1649,6 @@ def test_create_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_log_metric_empty_call(): - client = MetricsServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_log_metric), - '__call__') as call: - call.return_value = logging_metrics.LogMetric() - client.create_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() - - def test_create_log_metric_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1822,36 +1708,6 @@ def test_create_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_log_metric_empty_call_async(): - client = MetricsServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_log_metric), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( - name='name_value', - description='description_value', - filter='filter_value', - bucket_name='bucket_name_value', - disabled=True, - value_extractor='value_extractor_value', - version=logging_metrics.LogMetric.ApiVersion.V1, - )) - await client.create_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() - - @pytest.mark.asyncio async def test_create_log_metric_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2137,26 +1993,6 @@ def test_update_log_metric(request_type, transport: str = 'grpc'): assert response.version == logging_metrics.LogMetric.ApiVersion.V1 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_log_metric_empty_call(): - client = MetricsServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_log_metric), - '__call__') as call: - call.return_value = logging_metrics.LogMetric() - client.update_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() - - def test_update_log_metric_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2216,36 +2052,6 @@ def test_update_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_log_metric_empty_call_async(): - client = MetricsServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_log_metric), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( - name='name_value', - description='description_value', - filter='filter_value', - bucket_name='bucket_name_value', - disabled=True, - value_extractor='value_extractor_value', - version=logging_metrics.LogMetric.ApiVersion.V1, - )) - await client.update_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() - - @pytest.mark.asyncio async def test_update_log_metric_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2516,26 +2322,6 @@ def test_delete_log_metric(request_type, transport: str = 'grpc'): assert response is None -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_log_metric_empty_call(): - client = MetricsServiceV2Client( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_log_metric), - '__call__') as call: - call.return_value = None - client.delete_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() - - def test_delete_log_metric_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2595,28 +2381,6 @@ def test_delete_log_metric_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_log_metric_empty_call_async(): - client = MetricsServiceV2AsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_log_metric), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_log_metric(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() - - @pytest.mark.asyncio async def test_delete_log_metric_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2923,6 +2687,102 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_log_metrics_empty_call(): + client = MetricsServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_log_metrics), + '__call__') as call: + call.return_value = logging_metrics.ListLogMetricsResponse() + client.list_log_metrics(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.ListLogMetricsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_log_metric_empty_call(): + client = MetricsServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_log_metric), + '__call__') as call: + call.return_value = logging_metrics.LogMetric() + client.get_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.GetLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_log_metric_empty_call(): + client = MetricsServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_log_metric), + '__call__') as call: + call.return_value = logging_metrics.LogMetric() + client.create_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.CreateLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_log_metric_empty_call(): + client = MetricsServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_log_metric), + '__call__') as call: + call.return_value = logging_metrics.LogMetric() + client.update_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.UpdateLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_log_metric_empty_call(): + client = MetricsServiceV2Client( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_log_metric), + '__call__') as call: + call.return_value = None + client.delete_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.DeleteLogMetricRequest() + + def test_transport_kind_grpc_asyncio(): transport = MetricsServiceV2AsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -2930,6 +2790,138 @@ def test_transport_kind_grpc_asyncio(): assert transport.kind == "grpc_asyncio" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_log_metrics_empty_call_async(): + client = MetricsServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_log_metrics), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.ListLogMetricsResponse( + next_page_token='next_page_token_value', + )) + await client.list_log_metrics(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.ListLogMetricsRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_log_metric_empty_call_async(): + client = MetricsServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_log_metric), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( + name='name_value', + description='description_value', + filter='filter_value', + bucket_name='bucket_name_value', + disabled=True, + value_extractor='value_extractor_value', + version=logging_metrics.LogMetric.ApiVersion.V1, + )) + await client.get_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.GetLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_log_metric_empty_call_async(): + client = MetricsServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_log_metric), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( + name='name_value', + description='description_value', + filter='filter_value', + bucket_name='bucket_name_value', + disabled=True, + value_extractor='value_extractor_value', + version=logging_metrics.LogMetric.ApiVersion.V1, + )) + await client.create_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.CreateLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_log_metric_empty_call_async(): + client = MetricsServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_log_metric), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(logging_metrics.LogMetric( + name='name_value', + description='description_value', + filter='filter_value', + bucket_name='bucket_name_value', + disabled=True, + value_extractor='value_extractor_value', + version=logging_metrics.LogMetric.ApiVersion.V1, + )) + await client.update_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.UpdateLogMetricRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_log_metric_empty_call_async(): + client = MetricsServiceV2AsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_log_metric), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_log_metric(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == logging_metrics.DeleteLogMetricRequest() + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = MetricsServiceV2Client( diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index 20bc3fbe34..31bac5173e 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -821,26 +821,6 @@ def test_list_instances(request_type, transport: str = 'grpc'): assert response.unreachable == ['unreachable_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_list_instances_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_instances), - '__call__') as call: - call.return_value = cloud_redis.ListInstancesResponse() - client.list_instances(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() - - def test_list_instances_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -902,31 +882,6 @@ def test_list_instances_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_list_instances_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_instances), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.ListInstancesResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - await client.list_instances(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() - - @pytest.mark.asyncio async def test_list_instances_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1428,26 +1383,6 @@ def test_get_instance(request_type, transport: str = 'grpc'): assert response.available_maintenance_versions == ['available_maintenance_versions_value'] -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_instance), - '__call__') as call: - call.return_value = cloud_redis.Instance() - client.get_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() - - def test_get_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1507,56 +1442,6 @@ def test_get_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.Instance( - name='name_value', - display_name='display_name_value', - location_id='location_id_value', - alternative_location_id='alternative_location_id_value', - redis_version='redis_version_value', - reserved_ip_range='reserved_ip_range_value', - secondary_ip_range='secondary_ip_range_value', - host='host_value', - port=453, - current_location_id='current_location_id_value', - state=cloud_redis.Instance.State.CREATING, - status_message='status_message_value', - tier=cloud_redis.Instance.Tier.BASIC, - memory_size_gb=1499, - authorized_network='authorized_network_value', - persistence_iam_identity='persistence_iam_identity_value', - connect_mode=cloud_redis.Instance.ConnectMode.DIRECT_PEERING, - auth_enabled=True, - transit_encryption_mode=cloud_redis.Instance.TransitEncryptionMode.SERVER_AUTHENTICATION, - replica_count=1384, - read_endpoint='read_endpoint_value', - read_endpoint_port=1920, - read_replicas_mode=cloud_redis.Instance.ReadReplicasMode.READ_REPLICAS_DISABLED, - customer_managed_key='customer_managed_key_value', - suspension_reasons=[cloud_redis.Instance.SuspensionReason.CUSTOMER_MANAGED_KEY_ISSUE], - maintenance_version='maintenance_version_value', - available_maintenance_versions=['available_maintenance_versions_value'], - )) - await client.get_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() - - @pytest.mark.asyncio async def test_get_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -1860,26 +1745,6 @@ def test_get_instance_auth_string(request_type, transport: str = 'grpc'): assert response.auth_string == 'auth_string_value' -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_get_instance_auth_string_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_instance_auth_string), - '__call__') as call: - call.return_value = cloud_redis.InstanceAuthString() - client.get_instance_auth_string(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() - - def test_get_instance_auth_string_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -1939,30 +1804,6 @@ def test_get_instance_auth_string_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_get_instance_auth_string_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_instance_auth_string), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.InstanceAuthString( - auth_string='auth_string_value', - )) - await client.get_instance_auth_string(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() - - @pytest.mark.asyncio async def test_get_instance_auth_string_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2211,26 +2052,6 @@ def test_create_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_create_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.create_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() - - def test_create_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2297,30 +2118,6 @@ def test_create_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_create_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.create_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() - - @pytest.mark.asyncio async def test_create_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2595,26 +2392,6 @@ def test_update_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_update_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.update_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() - - def test_update_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -2677,30 +2454,6 @@ def test_update_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_update_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.update_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() - - @pytest.mark.asyncio async def test_update_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -2965,32 +2718,12 @@ def test_upgrade_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_upgrade_instance_empty_call(): +def test_upgrade_instance_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.upgrade_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.upgrade_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() - - -def test_upgrade_instance_non_empty_request_with_auto_populated_field(): - # This test is a coverage failsafe to make sure that UUID4 fields are - # automatically populated, according to AIP-4235, with non-empty requests. - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', + transport='grpc', ) # Populate all string fields in the request which are not UUID4 @@ -3051,30 +2784,6 @@ def test_upgrade_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_upgrade_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.upgrade_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.upgrade_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() - - @pytest.mark.asyncio async def test_upgrade_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3339,26 +3048,6 @@ def test_import_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_import_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.import_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.import_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() - - def test_import_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3423,30 +3112,6 @@ def test_import_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_import_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.import_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.import_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() - - @pytest.mark.asyncio async def test_import_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -3711,26 +3376,6 @@ def test_export_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_export_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.export_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.export_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() - - def test_export_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -3795,30 +3440,6 @@ def test_export_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_export_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.export_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.export_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() - - @pytest.mark.asyncio async def test_export_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4083,26 +3704,6 @@ def test_failover_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_failover_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.failover_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.failover_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() - - def test_failover_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4167,30 +3768,6 @@ def test_failover_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_failover_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.failover_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.failover_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() - - @pytest.mark.asyncio async def test_failover_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4455,26 +4032,6 @@ def test_delete_instance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_delete_instance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_instance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.delete_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() - - def test_delete_instance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4539,30 +4096,6 @@ def test_delete_instance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_delete_instance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_instance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.delete_instance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() - - @pytest.mark.asyncio async def test_delete_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, @@ -4817,26 +4350,6 @@ def test_reschedule_maintenance(request_type, transport: str = 'grpc'): assert isinstance(response, future.Future) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -def test_reschedule_maintenance_empty_call(): - client = CloudRedisClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reschedule_maintenance), - '__call__') as call: - call.return_value = operations_pb2.Operation(name='operations/op') - client.reschedule_maintenance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() - - def test_reschedule_maintenance_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. @@ -4901,39 +4414,15 @@ def test_reschedule_maintenance_use_cached_wrapped_rpc(): assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_reschedule_maintenance_empty_call_async(): - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reschedule_maintenance), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name='operations/spam') - ) - await client.reschedule_maintenance(request=None) - - # Establish that the underlying gRPC stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() - - -@pytest.mark.asyncio -async def test_reschedule_maintenance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): - # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, - # instead of constructing them on each call - with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = CloudRedisAsyncClient( - credentials=async_anonymous_credentials(), - transport=transport, - ) +async def test_reschedule_maintenance_async_use_cached_wrapped_rpc(transport: str = "grpc_asyncio"): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) # Should wrap all calls on client creation assert wrapper_fn.call_count > 0 @@ -8432,6 +7921,216 @@ def test_transport_kind_grpc(): assert transport.kind == "grpc" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_instances_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_instances), + '__call__') as call: + call.return_value = cloud_redis.ListInstancesResponse() + client.list_instances(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ListInstancesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance), + '__call__') as call: + call.return_value = cloud_redis.Instance() + client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_instance_auth_string_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance_auth_string), + '__call__') as call: + call.return_value = cloud_redis.InstanceAuthString() + client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.CreateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpdateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_upgrade_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upgrade_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpgradeInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_import_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ImportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_export_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ExportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_failover_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.failover_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.FailoverInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.DeleteInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_reschedule_maintenance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reschedule_maintenance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + + def test_transport_kind_grpc_asyncio(): transport = CloudRedisAsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -8439,18 +8138,790 @@ def test_transport_kind_grpc_asyncio(): assert transport.kind == "grpc_asyncio" -def test_transport_kind_rest(): - transport = CloudRedisClient.get_transport_class("rest")( - credentials=ga_credentials.AnonymousCredentials() +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_instances_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), ) - assert transport.kind == "rest" + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_instances), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.ListInstancesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_instances(request=None) -def test_transport_kind_rest_asyncio(): - transport = CloudRedisAsyncClient.get_transport_class("rest_asyncio")( - credentials=async_anonymous_credentials() + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ListInstancesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.Instance( + name='name_value', + display_name='display_name_value', + location_id='location_id_value', + alternative_location_id='alternative_location_id_value', + redis_version='redis_version_value', + reserved_ip_range='reserved_ip_range_value', + secondary_ip_range='secondary_ip_range_value', + host='host_value', + port=453, + current_location_id='current_location_id_value', + state=cloud_redis.Instance.State.CREATING, + status_message='status_message_value', + tier=cloud_redis.Instance.Tier.BASIC, + memory_size_gb=1499, + authorized_network='authorized_network_value', + persistence_iam_identity='persistence_iam_identity_value', + connect_mode=cloud_redis.Instance.ConnectMode.DIRECT_PEERING, + auth_enabled=True, + transit_encryption_mode=cloud_redis.Instance.TransitEncryptionMode.SERVER_AUTHENTICATION, + replica_count=1384, + read_endpoint='read_endpoint_value', + read_endpoint_port=1920, + read_replicas_mode=cloud_redis.Instance.ReadReplicasMode.READ_REPLICAS_DISABLED, + customer_managed_key='customer_managed_key_value', + suspension_reasons=[cloud_redis.Instance.SuspensionReason.CUSTOMER_MANAGED_KEY_ISSUE], + maintenance_version='maintenance_version_value', + available_maintenance_versions=['available_maintenance_versions_value'], + )) + await client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_instance_auth_string_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance_auth_string), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.InstanceAuthString( + auth_string='auth_string_value', + )) + await client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.CreateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpdateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_upgrade_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upgrade_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpgradeInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_import_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ImportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_export_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ExportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_failover_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.failover_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.FailoverInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.DeleteInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_reschedule_maintenance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reschedule_maintenance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + + +def test_transport_kind_rest(): + transport = CloudRedisClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_instances_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_instances), + '__call__') as call: + call.return_value = cloud_redis.ListInstancesResponse() + client.list_instances(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ListInstancesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance), + '__call__') as call: + call.return_value = cloud_redis.Instance() + client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_instance_auth_string_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance_auth_string), + '__call__') as call: + call.return_value = cloud_redis.InstanceAuthString() + client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.CreateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpdateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_upgrade_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upgrade_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpgradeInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_import_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ImportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_export_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ExportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_failover_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.failover_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.FailoverInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_instance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_instance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.DeleteInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_reschedule_maintenance_empty_call(): + client = CloudRedisClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reschedule_maintenance), + '__call__') as call: + call.return_value = operations_pb2.Operation(name='operations/op') + client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + + +def test_transport_kind_rest_asyncio(): + transport = CloudRedisAsyncClient.get_transport_class("rest_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "rest_asyncio" + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_instances_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_instances), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.ListInstancesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + await client.list_instances(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ListInstancesRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), ) - assert transport.kind == "rest_asyncio" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.Instance( + name='name_value', + display_name='display_name_value', + location_id='location_id_value', + alternative_location_id='alternative_location_id_value', + redis_version='redis_version_value', + reserved_ip_range='reserved_ip_range_value', + secondary_ip_range='secondary_ip_range_value', + host='host_value', + port=453, + current_location_id='current_location_id_value', + state=cloud_redis.Instance.State.CREATING, + status_message='status_message_value', + tier=cloud_redis.Instance.Tier.BASIC, + memory_size_gb=1499, + authorized_network='authorized_network_value', + persistence_iam_identity='persistence_iam_identity_value', + connect_mode=cloud_redis.Instance.ConnectMode.DIRECT_PEERING, + auth_enabled=True, + transit_encryption_mode=cloud_redis.Instance.TransitEncryptionMode.SERVER_AUTHENTICATION, + replica_count=1384, + read_endpoint='read_endpoint_value', + read_endpoint_port=1920, + read_replicas_mode=cloud_redis.Instance.ReadReplicasMode.READ_REPLICAS_DISABLED, + customer_managed_key='customer_managed_key_value', + suspension_reasons=[cloud_redis.Instance.SuspensionReason.CUSTOMER_MANAGED_KEY_ISSUE], + maintenance_version='maintenance_version_value', + available_maintenance_versions=['available_maintenance_versions_value'], + )) + await client.get_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_instance_auth_string_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_instance_auth_string), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(cloud_redis.InstanceAuthString( + auth_string='auth_string_value', + )) + await client.get_instance_auth_string(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.create_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.CreateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.update_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpdateInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_upgrade_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upgrade_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.upgrade_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.UpgradeInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_import_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.import_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ImportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_export_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.export_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.export_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.ExportInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_failover_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.failover_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.failover_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.FailoverInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_instance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_instance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.delete_instance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.DeleteInstanceRequest() + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_reschedule_maintenance_empty_call_async(): + client = CloudRedisAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reschedule_maintenance), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name='operations/spam') + ) + await client.reschedule_maintenance(request=None) + + # Establish that the underlying gRPC stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cloud_redis.RescheduleMaintenanceRequest() def test_transport_grpc_default(): From d9664afff5554927d463873fe0107c852e9193d6 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 8 Sep 2024 23:51:10 +0000 Subject: [PATCH 08/23] test: improve routing parameter assert --- gapic/schema/wrappers.py | 60 +++++++++++++++++++ .../gapic/%name_%version/%sub/test_macros.j2 | 7 +-- tests/unit/schema/wrappers/test_routing.py | 54 ++++++++--------- 3 files changed, 88 insertions(+), 33 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index fd75e8fd5e..0a54e09b19 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1067,6 +1067,66 @@ def try_parse_routing_rule(cls, routing_rule: routing_pb2.RoutingRule) -> Option params = [RoutingParameter(x.field, x.path_template) for x in params] return cls(params) + @classmethod + def resolve(cls, routing_rule: routing_pb2.RoutingRule, request: Union[dict, str]) -> dict: + """Resolves the routing header which should be sent along with the request. + This function performs dynamic header resolution, identical to what's in `client.py.j2`. + The routing header is determined based on the given routing rule and request. + See the following link for more information on explicit routing headers: + https://google.aip.dev/client-libraries/4222#explicit-routing-headers-googleapirouting + + Args: + routing_rule(routing_pb2.RoutingRule): A collection of Routing Parameter specifications + defined by `routing_pb2.RoutingRule`. + See https://github.com/googleapis/googleapis/blob/cb39bdd75da491466f6c92bc73cd46b0fbd6ba9a/google/api/routing.proto#L391 + request(Union[dict, str]): The request for which the routine rule should be resolved. + The format can be either a dictionary or json string representing the request. + + Returns(dict): + A dictionary containing the resolved routing header to the sent along with the given request. + """ + + def _get_field(request, field_path: str): + segments = field_path.split(".") + + # Either json string or dictionary is supported + if isinstance(request, str): + current = json.loads(request) + else: + current = request + + # This is to cater for the case where the `field_path` contains a + # dot-separated path of field names leading to a field in a sub-message. + for x in segments: + current = current.get(x, None) + # Break if the sub-message does not exist + if current is None: + break + return current + + header_params = {} + for routing_param in routing_rule.routing_parameters: + request_field_value = _get_field(request, routing_param.field) + # Only resolve the header for routing parameter fields which are populated in the request + if request_field_value is not None: + # If there is a path_template for a given routing parameter field, the value of the field must match + # If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + if routing_param.path_template: + routing_param_regex = routing_param.to_regex() + regex_match = routing_param_regex.match( + request_field_value + ) + if regex_match: + header_params[routing_param.key] = regex_match.group( + routing_param.key + ) + else: # No need to match + header_params[routing_param.key] = request_field_value + return header_params + @dataclasses.dataclass(frozen=True) class HttpRule: diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 2f2fb3b74f..4c7520781b 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -422,12 +422,11 @@ def test_{{ method.name|snake_case }}_routing_parameters(): # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] + _, args, kw = call.mock_calls[0] assert args[0] == request - _, _, kw = call.mock_calls[0] - # This test doesn't assert anything useful. - assert kw['metadata'] + expected_headers = {{ method.routing_rule.resolve(method.routing_rule, routing_param.sample_request) }} + assert gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw['metadata'] {% endfor %} {% endif %} diff --git a/tests/unit/schema/wrappers/test_routing.py b/tests/unit/schema/wrappers/test_routing.py index f93d6680a0..f4e6215bca 100644 --- a/tests/unit/schema/wrappers/test_routing.py +++ b/tests/unit/schema/wrappers/test_routing.py @@ -14,6 +14,7 @@ from gapic.schema import wrappers +import json import proto import pytest @@ -23,31 +24,6 @@ class RoutingTestRequest(proto.Message): app_profile_id = proto.Field(proto.STRING, number=2) -def resolve(rule, request): - """This function performs dynamic header resolution, identical to what's in client.py.j2.""" - - def _get_field(request, field_path: str): - segments = field_path.split(".") - cur = request - for x in segments: - cur = getattr(cur, x) - return cur - - header_params = {} - for routing_param in rule.routing_parameters: - # This may raise exception (which we show to clients). - request_field_value = _get_field(request, routing_param.field) - if routing_param.path_template: - routing_param_regex = routing_param.to_regex() - regex_match = routing_param_regex.match(request_field_value) - if regex_match: - header_params[routing_param.key] = regex_match.group( - routing_param.key) - else: # No need to match - header_params[routing_param.key] = request_field_value - return header_params - - @pytest.mark.parametrize( "req, expected", [ @@ -63,7 +39,10 @@ def _get_field(request, field_path: str): def test_routing_rule_resolve_simple_extraction(req, expected): rule = wrappers.RoutingRule( [wrappers.RoutingParameter("app_profile_id", "")]) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -82,7 +61,10 @@ def test_routing_rule_resolve_rename_extraction(req, expected): rule = wrappers.RoutingRule( [wrappers.RoutingParameter("app_profile_id", "{routing_id=**}")] ) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -111,7 +93,10 @@ def test_routing_rule_resolve_field_match(req, expected): ), ] ) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -135,6 +120,9 @@ def test_routing_rule_resolve_field_match(req, expected): wrappers.RoutingParameter( "table_name", "projects/*/{instance_id=instances/*}/**" ), + wrappers.RoutingParameter( + "doesnotexist", "projects/*/{instance_id=instances/*}/**" + ), ], RoutingTestRequest( table_name="projects/100/instances/200/tables/300"), @@ -144,7 +132,15 @@ def test_routing_rule_resolve_field_match(req, expected): ) def test_routing_rule_resolve(routing_parameters, req, expected): rule = wrappers.RoutingRule(routing_parameters) - got = resolve(rule, req) + got = wrappers.RoutingRule.resolve( + rule, RoutingTestRequest.to_dict(req) + ) + assert got == expected + + rule = wrappers.RoutingRule(routing_parameters) + got = wrappers.RoutingRule.resolve( + rule, json.dumps(RoutingTestRequest.to_dict(req)) + ) assert got == expected From 1691274b2ef43bdccb60280129658332c1cf58d7 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 9 Sep 2024 00:36:40 +0000 Subject: [PATCH 09/23] chore: refactor routing_parameters test --- .../%sub/services/%service/_client_macros.j2 | 40 +- .../%sub/services/%service/_shared_macros.j2 | 41 ++ .../%sub/services/%service/async_client.py.j2 | 15 +- .../%name_%version/%sub/test_%service.py.j2 | 1 + .../gapic/%name_%version/%sub/test_macros.j2 | 69 +-- .../asset_v1/services/asset_service/client.py | 46 +- .../unit/gapic/asset_v1/test_asset_service.py | 480 +++++++++++++----- .../services/iam_credentials/client.py | 8 +- .../credentials_v1/test_iam_credentials.py | 81 ++- .../eventarc_v1/services/eventarc/client.py | 36 +- .../unit/gapic/eventarc_v1/test_eventarc.py | 375 ++++++++++---- .../services/config_service_v2/client.py | 62 +-- .../services/logging_service_v2/client.py | 4 +- .../services/metrics_service_v2/client.py | 10 +- .../logging_v2/test_config_service_v2.py | 446 +++++++++++----- .../logging_v2/test_logging_service_v2.py | 68 ++- .../logging_v2/test_metrics_service_v2.py | 68 ++- .../redis_v1/services/cloud_redis/client.py | 22 +- .../unit/gapic/redis_v1/test_cloud_redis.py | 304 +++++++---- 19 files changed, 1457 insertions(+), 719 deletions(-) diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_client_macros.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_client_macros.j2 index e741d6d047..7eeda037b7 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_client_macros.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_client_macros.j2 @@ -144,45 +144,7 @@ # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.{{ method.transport_safe_name|snake_case}}] - {% if method.explicit_routing %} - header_params = {} - {% if not method.client_streaming %} - {% for routing_param in method.routing_rule.routing_parameters %} - {% if routing_param.path_template %} {# Need to match. #} - - routing_param_regex = {{ routing_param.to_regex() }} - regex_match = routing_param_regex.match(request.{{ routing_param.field }}) - if regex_match and regex_match.group("{{ routing_param.key }}"): - header_params["{{ routing_param.key }}"] = regex_match.group("{{ routing_param.key }}") - - {% else %} - - if request.{{ routing_param.field }}: - header_params["{{ routing_param.key }}"] = request.{{ routing_param.field }} - - {% endif %} - {% endfor %} {# method.routing_rule.routing_parameters #} - {% endif %} {# if not method.client_streaming #} - - if header_params: - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(header_params), - ) - - {% elif method.field_headers %} {# implicit routing #} - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - {% for field_header in method.field_headers %} - {% if not method.client_streaming %} - ("{{ field_header.raw }}", request.{{ field_header.disambiguated }}), - {% endif %} - {% endfor %} - )), - ) - {% endif %} {# method.explicit_routing #} - +{{ shared_macros.create_metadata(method) }} {{ shared_macros.add_api_version_header_to_metadata(service.version) }} {{ shared_macros.auto_populate_uuid4_fields(api, method) }} diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 index b7b223caad..e84183de18 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 @@ -55,6 +55,47 @@ except ImportError: # pragma: NO COVER {% endif %}{# service_version #} {% endmacro %} +{% macro create_metadata(method) %} + {% if method.explicit_routing %} + header_params = {} + {% if not method.client_streaming %} + {% for routing_param in method.routing_rule.routing_parameters %} + {% if routing_param.path_template %} {# Need to match. #} + + routing_param_regex = {{ routing_param.to_regex() }} + regex_match = routing_param_regex.match(request.{{ routing_param.field }}) + if regex_match and regex_match.group("{{ routing_param.key }}"): + header_params["{{ routing_param.key }}"] = regex_match.group("{{ routing_param.key }}") + + {% else %} + + if request.{{ routing_param.field }}: + header_params["{{ routing_param.key }}"] = request.{{ routing_param.field }} + + {% endif %} + {% endfor %} {# method.routing_rule.routing_parameters #} + {% endif %} {# if not method.client_streaming #} + + if header_params: + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(header_params), + ) + + {% elif method.field_headers %}{# implicit routing #} + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + {% for field_header in method.field_headers %} + {% if not method.client_streaming %} + ("{{ field_header.raw }}", request.{{ field_header.disambiguated }}), + {% endif %} + {% endfor %} + )), + ) + {% endif %}{# method.explicit_routing #} +{% endmacro %}{# create_metadata #} + {% macro add_api_version_header_to_metadata(service_version) %} {# Add API Version to metadata as per https://github.com/aip-dev/google.aip.dev/pull/1331. diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index 36a40f4db0..11171569bd 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -364,20 +364,7 @@ class {{ service.async_client_name }}: # and friendly error handling. rpc = self._client._transport._wrapped_methods[self._client._transport.{{ method.transport_safe_name|snake_case }}] - {% if method.field_headers %} - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - {% for field_header in method.field_headers %} - {% if not method.client_streaming %} - ("{{ field_header.raw }}", request.{{ field_header.disambiguated }}), - {% endif %} - {% endfor %} - )), - ) - {% endif %} - +{{ shared_macros.create_metadata(method) }} {{ shared_macros.add_api_version_header_to_metadata(service.version) }} {{ shared_macros.auto_populate_uuid4_fields(api, method) }} diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index d6d1931190..6e310f225d 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -1054,6 +1054,7 @@ def test_transport_adc(transport_class): {% for conf in configs %} {{ test_macros.transport_kind_test(**conf) }} {{ test_macros.empty_call_test(**conf) }} +{{ test_macros.routing_parameter_test(**conf) }} {% endfor %} {% if 'grpc' in opts.transport %} diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index f307a5218c..1502623e76 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -386,43 +386,6 @@ async def test_{{ method_name }}_async_from_dict(): await test_{{ method_name }}_async(request_type=dict) {% endif %}{# full_extended_lro #} -{% if method.explicit_routing %} -def test_{{ method.name|snake_case }}_routing_parameters(): - client = {{ service.client_name }}( - credentials=ga_credentials.AnonymousCredentials(), - ) - - {% for routing_param in method.routing_rule.routing_parameters %} - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = {{ method.input.ident }}(**{{ routing_param.sample_request }}) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.{{ method.transport_safe_name|snake_case }}), - '__call__') as call: - {% if method.void %} - call.return_value = None - {% elif method.lro %} - call.return_value = operations_pb2.Operation(name='operations/op') - {% elif method.server_streaming %} - call.return_value = iter([{{ method.output.ident }}()]) - {% else %} - call.return_value = {{ method.output.ident }}() - {% endif %} - client.{{ method.safe_name|snake_case }}(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - _, _, kw = call.mock_calls[0] - # This test doesn't assert anything useful. - assert kw['metadata'] - {% endfor %} -{% endif %} - {% if method.field_headers and not method.client_streaming and not method.explicit_routing %} def test_{{ method_name }}_field_headers(): @@ -1799,7 +1762,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endmacro %} -{% macro method_call_test(test_name, method, service, api, request, is_async=False) %} +{% macro method_call_test(test_name, method, service, api, request_dict, is_async=False) %} {% with method_name = method.name|snake_case + "_unary" if method.operation_service else method.name|snake_case %} {% set await_prefix = "await " if is_async else "" %} {% set async_method_prefix = "async " if is_async else "" %} @@ -1840,7 +1803,7 @@ def test_{{ method_name }}_rest_no_http_options(): {% endfor %} )) {% endif %}{# method.void #} - await client.{{ method_name }}(request={{ request }}) + await client.{{ method_name }}(request={{ request_dict }}) {% else %}{# if not is_async #} {% if method.void %} call.return_value = None @@ -1851,12 +1814,12 @@ def test_{{ method_name }}_rest_no_http_options(): {% else %} call.return_value = {{ method.output.ident }}() {% endif %} - client.{{ method_name }}(request={{ request }}) + client.{{ method_name }}(request={{ request_dict }}) {% endif %}{# is_async #} # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] + _, args, kw = call.mock_calls[0] {% with method_settings = api.all_method_settings.get(method.meta.address.proto) %} {% if method_settings is not none %} {% for auto_populated_field in method_settings.auto_populated_fields %} @@ -1867,11 +1830,13 @@ def test_{{ method_name }}_rest_no_http_options(): {% endfor %}{# for auto_populated_field in method_settings.auto_populated_fields #} {% endif %}{# if method_settings is not none #} {% endwith %}{# method_settings #} - {% if request %} - assert args[0] == {{ request }} + {% if request_dict %} + request_msg = {{ method.input.ident }}(**{{ request_dict }}) {% else %} - assert args[0] == {{ method.input.ident }}() - {% endif %}{# request #} + request_msg = {{ method.input.ident }}() + {% endif %}{# request_dict #} + assert args[0] == request_msg + {% endwith %}{# method_name #} {% endmacro %} @@ -1902,7 +1867,7 @@ def test_transport_kind_{{ transport_name }}(): {% if not method.client_streaming %} # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -{{ method_call_test("empty_call", method, service, api, request=None, is_async=is_async) }} +{{ method_call_test("empty_call", method, service, api, request_dict=None, is_async=is_async) }} {% endif %}{# not method.client_streaming #} {% endfor %}{# method in service.methods.values() #} {% endmacro %}{# empty_call_test #} @@ -1910,3 +1875,15 @@ def test_transport_kind_{{ transport_name }}(): {% macro get_uuid4_re() -%} [a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12} {%- endmacro %}{# uuid_re #} + +{% macro routing_parameter_test(service, api, transport, is_async) %} +{% for method in service.methods.values() %}{# method #} +{% if method.explicit_routing %} +{# Any value that is part of the HTTP/1.1 URI should be sent as #} +{# a field header. Set these to a non-empty value. #} +{% for routing_param in method.routing_rule.routing_parameters %} +{{ method_call_test("routing_parameters_request_" + loop.index|string, method, service, api, request_dict=routing_param.sample_request,is_async=is_async) }} +{% endfor %}{# routing_param in method.routing_rule.routing_parameters #} +{% endif %}{# method.explicit_routing #} +{% endfor %}{# method in service.methods.values() #} +{% endmacro %}{# routing_parameter_test #} diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py index 54349918c7..64b52c14bb 100755 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py @@ -730,7 +730,7 @@ def sample_export_assets(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.export_assets] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -849,7 +849,7 @@ def sample_list_assets(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_assets] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -946,7 +946,7 @@ def sample_batch_get_assets_history(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.batch_get_assets_history] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1067,7 +1067,7 @@ def sample_create_feed(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_feed] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1176,7 +1176,7 @@ def sample_get_feed(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_feed] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1280,7 +1280,7 @@ def sample_list_feeds(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_feeds] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1393,7 +1393,7 @@ def sample_update_feed(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_feed] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1487,7 +1487,7 @@ def sample_delete_feed(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_feed] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1702,7 +1702,7 @@ def sample_search_all_resources(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.search_all_resources] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1892,7 +1892,7 @@ def sample_search_all_iam_policies(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.search_all_iam_policies] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1990,7 +1990,7 @@ def sample_analyze_iam_policy(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_iam_policy] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2097,7 +2097,7 @@ def sample_analyze_iam_policy_longrunning(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_iam_policy_longrunning] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2195,7 +2195,7 @@ def sample_analyze_move(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_move] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2291,7 +2291,7 @@ def sample_query_assets(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.query_assets] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2427,7 +2427,7 @@ def sample_create_saved_query(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_saved_query] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2532,7 +2532,7 @@ def sample_get_saved_query(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_saved_query] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2643,7 +2643,7 @@ def sample_list_saved_queries(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_saved_queries] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2770,7 +2770,7 @@ def sample_update_saved_query(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_saved_query] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2866,7 +2866,7 @@ def sample_delete_saved_query(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_saved_query] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2947,7 +2947,7 @@ def sample_batch_get_effective_iam_policies(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.batch_get_effective_iam_policies] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3087,7 +3087,7 @@ def sample_analyze_org_policies(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_org_policies] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3238,7 +3238,7 @@ def sample_analyze_org_policy_governed_containers(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_org_policy_governed_containers] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3418,7 +3418,7 @@ def sample_analyze_org_policy_governed_assets(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.analyze_org_policy_governed_assets] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 5b83567e79..e908059746 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -15448,8 +15448,11 @@ def test_export_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ExportAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15467,8 +15470,11 @@ def test_list_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15486,8 +15492,11 @@ def test_batch_get_assets_history_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetAssetsHistoryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15505,8 +15514,11 @@ def test_create_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15524,8 +15536,11 @@ def test_get_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15543,8 +15558,11 @@ def test_list_feeds_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListFeedsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15562,8 +15580,11 @@ def test_update_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15581,8 +15602,11 @@ def test_delete_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15600,8 +15624,11 @@ def test_search_all_resources_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllResourcesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15619,8 +15646,11 @@ def test_search_all_iam_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15638,8 +15668,11 @@ def test_analyze_iam_policy_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15657,8 +15690,11 @@ def test_analyze_iam_policy_longrunning_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15676,8 +15712,11 @@ def test_analyze_move_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeMoveRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15695,8 +15734,11 @@ def test_query_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.QueryAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15714,8 +15756,11 @@ def test_create_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15733,8 +15778,11 @@ def test_get_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15752,8 +15800,11 @@ def test_list_saved_queries_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListSavedQueriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15771,8 +15822,11 @@ def test_update_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15790,8 +15844,11 @@ def test_delete_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15809,8 +15866,11 @@ def test_batch_get_effective_iam_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15828,8 +15888,11 @@ def test_analyze_org_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15847,8 +15910,11 @@ def test_analyze_org_policy_governed_containers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15866,8 +15932,10 @@ def test_analyze_org_policy_governed_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -15897,8 +15965,11 @@ async def test_export_assets_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ExportAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15920,8 +15991,11 @@ async def test_list_assets_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15942,8 +16016,11 @@ async def test_batch_get_assets_history_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetAssetsHistoryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15969,8 +16046,11 @@ async def test_create_feed_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15996,8 +16076,11 @@ async def test_get_feed_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16018,8 +16101,11 @@ async def test_list_feeds_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListFeedsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16045,8 +16131,11 @@ async def test_update_feed_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16066,8 +16155,11 @@ async def test_delete_feed_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16089,8 +16181,11 @@ async def test_search_all_resources_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllResourcesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16112,8 +16207,11 @@ async def test_search_all_iam_policies_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16135,8 +16233,11 @@ async def test_analyze_iam_policy_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16158,8 +16259,11 @@ async def test_analyze_iam_policy_longrunning_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16180,8 +16284,11 @@ async def test_analyze_move_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeMoveRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16204,8 +16311,11 @@ async def test_query_assets_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.QueryAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16230,8 +16340,11 @@ async def test_create_saved_query_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16256,8 +16369,11 @@ async def test_get_saved_query_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16279,8 +16395,11 @@ async def test_list_saved_queries_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListSavedQueriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16305,8 +16424,11 @@ async def test_update_saved_query_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16326,8 +16448,11 @@ async def test_delete_saved_query_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16348,8 +16473,11 @@ async def test_batch_get_effective_iam_policies_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16371,8 +16499,11 @@ async def test_analyze_org_policies_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16394,8 +16525,11 @@ async def test_analyze_org_policy_governed_containers_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16417,8 +16551,10 @@ async def test_analyze_org_policy_governed_assets_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): @@ -16444,8 +16580,11 @@ def test_export_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ExportAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16463,8 +16602,11 @@ def test_list_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16482,8 +16624,11 @@ def test_batch_get_assets_history_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetAssetsHistoryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16501,8 +16646,11 @@ def test_create_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16520,8 +16668,11 @@ def test_get_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16539,8 +16690,11 @@ def test_list_feeds_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListFeedsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16558,8 +16712,11 @@ def test_update_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16577,8 +16734,11 @@ def test_delete_feed_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteFeedRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16596,8 +16756,11 @@ def test_search_all_resources_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllResourcesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16615,8 +16778,11 @@ def test_search_all_iam_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16634,8 +16800,11 @@ def test_analyze_iam_policy_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16653,8 +16822,11 @@ def test_analyze_iam_policy_longrunning_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16672,8 +16844,11 @@ def test_analyze_move_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeMoveRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16691,8 +16866,11 @@ def test_query_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.QueryAssetsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16710,8 +16888,11 @@ def test_create_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16729,8 +16910,11 @@ def test_get_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16748,8 +16932,11 @@ def test_list_saved_queries_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListSavedQueriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16767,8 +16954,11 @@ def test_update_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16786,8 +16976,11 @@ def test_delete_saved_query_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteSavedQueryRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16805,8 +16998,11 @@ def test_batch_get_effective_iam_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16824,8 +17020,11 @@ def test_analyze_org_policies_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPoliciesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16843,8 +17042,11 @@ def test_analyze_org_policy_governed_containers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16862,8 +17064,10 @@ def test_analyze_org_policy_governed_assets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py index b38845b359..b9597ea226 100755 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py @@ -714,7 +714,7 @@ def sample_generate_access_token(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.generate_access_token] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -862,7 +862,7 @@ def sample_generate_id_token(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.generate_id_token] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -996,7 +996,7 @@ def sample_sign_blob(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.sign_blob] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1133,7 +1133,7 @@ def sample_sign_jwt(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.sign_jwt] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 25adcdfb41..e286d7dcdd 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -3343,8 +3343,11 @@ def test_generate_access_token_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateAccessTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3362,8 +3365,11 @@ def test_generate_id_token_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateIdTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3381,8 +3387,11 @@ def test_sign_blob_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignBlobRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3400,8 +3409,10 @@ def test_sign_jwt_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignJwtRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -3431,8 +3442,11 @@ async def test_generate_access_token_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateAccessTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3454,8 +3468,11 @@ async def test_generate_id_token_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateIdTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3478,8 +3495,11 @@ async def test_sign_blob_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignBlobRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3502,8 +3522,10 @@ async def test_sign_jwt_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignJwtRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): @@ -3529,8 +3551,11 @@ def test_generate_access_token_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateAccessTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3548,8 +3573,11 @@ def test_generate_id_token_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateIdTokenRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3567,8 +3595,11 @@ def test_sign_blob_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignBlobRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3586,8 +3617,10 @@ def test_sign_jwt_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignJwtRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/client.py b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/client.py index ad080aa3ba..53e54c3e04 100755 --- a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/client.py +++ b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/client.py @@ -770,7 +770,7 @@ def sample_get_trigger(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_trigger] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -875,7 +875,7 @@ def sample_list_triggers(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_triggers] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1024,7 +1024,7 @@ def sample_create_trigger(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_trigger] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1162,7 +1162,7 @@ def sample_update_trigger(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_trigger] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1291,7 +1291,7 @@ def sample_delete_trigger(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_trigger] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1407,7 +1407,7 @@ def sample_get_channel(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_channel] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1512,7 +1512,7 @@ def sample_list_channels(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_channels] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1661,7 +1661,7 @@ def sample_create_channel(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_channel_] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1791,7 +1791,7 @@ def sample_update_channel(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_channel] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1912,7 +1912,7 @@ def sample_delete_channel(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_channel] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2022,7 +2022,7 @@ def sample_get_provider(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_provider] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2127,7 +2127,7 @@ def sample_list_providers(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_providers] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2245,7 +2245,7 @@ def sample_get_channel_connection(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_channel_connection] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2351,7 +2351,7 @@ def sample_list_channel_connections(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_channel_connections] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2500,7 +2500,7 @@ def sample_create_channel_connection(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_channel_connection] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2619,7 +2619,7 @@ def sample_delete_channel_connection(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_channel_connection] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2735,7 +2735,7 @@ def sample_get_google_channel_config(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_google_channel_config] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2856,7 +2856,7 @@ def sample_update_google_channel_config(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_google_channel_config] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index bcce38f0d2..cad091f374 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -13085,8 +13085,11 @@ def test_get_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13104,8 +13107,11 @@ def test_list_triggers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListTriggersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13123,8 +13129,11 @@ def test_create_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13142,8 +13151,11 @@ def test_update_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13161,8 +13173,11 @@ def test_delete_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13180,8 +13195,11 @@ def test_get_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13199,8 +13217,11 @@ def test_list_channels_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13218,8 +13239,11 @@ def test_create_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13237,8 +13261,11 @@ def test_update_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13256,8 +13283,11 @@ def test_delete_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13275,8 +13305,11 @@ def test_get_provider_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetProviderRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13294,8 +13327,11 @@ def test_list_providers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListProvidersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13313,8 +13349,11 @@ def test_get_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13332,8 +13371,11 @@ def test_list_channel_connections_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelConnectionsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13351,8 +13393,11 @@ def test_create_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13370,8 +13415,11 @@ def test_delete_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13389,8 +13437,11 @@ def test_get_google_channel_config_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetGoogleChannelConfigRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13408,8 +13459,10 @@ def test_update_google_channel_config_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateGoogleChannelConfigRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -13443,8 +13496,11 @@ async def test_get_trigger_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13467,8 +13523,11 @@ async def test_list_triggers_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListTriggersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13490,8 +13549,11 @@ async def test_create_trigger_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13513,8 +13575,11 @@ async def test_update_trigger_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13536,8 +13601,11 @@ async def test_delete_trigger_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13564,8 +13632,11 @@ async def test_get_channel_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13588,8 +13659,11 @@ async def test_list_channels_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13611,8 +13685,11 @@ async def test_create_channel_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13634,8 +13711,11 @@ async def test_update_channel_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13657,8 +13737,11 @@ async def test_delete_channel_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13681,8 +13764,11 @@ async def test_get_provider_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetProviderRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13705,8 +13791,11 @@ async def test_list_providers_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListProvidersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13731,8 +13820,11 @@ async def test_get_channel_connection_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13755,8 +13847,11 @@ async def test_list_channel_connections_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelConnectionsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13778,8 +13873,11 @@ async def test_create_channel_connection_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13801,8 +13899,11 @@ async def test_delete_channel_connection_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13825,8 +13926,11 @@ async def test_get_google_channel_config_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetGoogleChannelConfigRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13849,8 +13953,10 @@ async def test_update_google_channel_config_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateGoogleChannelConfigRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): @@ -13876,8 +13982,11 @@ def test_get_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13895,8 +14004,11 @@ def test_list_triggers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListTriggersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13914,8 +14026,11 @@ def test_create_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13933,8 +14048,11 @@ def test_update_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13952,8 +14070,11 @@ def test_delete_trigger_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteTriggerRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13971,8 +14092,11 @@ def test_get_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13990,8 +14114,11 @@ def test_list_channels_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14009,8 +14136,11 @@ def test_create_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14028,8 +14158,11 @@ def test_update_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14047,8 +14180,11 @@ def test_delete_channel_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14066,8 +14202,11 @@ def test_get_provider_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetProviderRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14085,8 +14224,11 @@ def test_list_providers_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListProvidersRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14104,8 +14246,11 @@ def test_get_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14123,8 +14268,11 @@ def test_list_channel_connections_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelConnectionsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14142,8 +14290,11 @@ def test_create_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14161,8 +14312,11 @@ def test_delete_channel_connection_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelConnectionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14180,8 +14334,11 @@ def test_get_google_channel_config_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetGoogleChannelConfigRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -14199,8 +14356,10 @@ def test_update_google_channel_config_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateGoogleChannelConfigRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py index 92a2df84cf..9ce55ae44f 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py @@ -732,7 +732,7 @@ def sample_list_buckets(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_buckets] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -825,7 +825,7 @@ def sample_get_bucket(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_bucket] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -918,7 +918,7 @@ def sample_create_bucket_async(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_bucket_async] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1021,7 +1021,7 @@ def sample_update_bucket_async(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_bucket_async] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1114,7 +1114,7 @@ def sample_create_bucket(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_bucket] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1202,7 +1202,7 @@ def sample_update_bucket(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_bucket] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1280,7 +1280,7 @@ def sample_delete_bucket(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_bucket] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1352,7 +1352,7 @@ def sample_undelete_bucket(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.undelete_bucket] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1457,7 +1457,7 @@ def sample_list_views(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_views] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1550,7 +1550,7 @@ def sample_get_view(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_view] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1634,7 +1634,7 @@ def sample_create_view(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_view] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1720,7 +1720,7 @@ def sample_update_view(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_view] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1796,7 +1796,7 @@ def sample_delete_view(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_view] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1904,7 +1904,7 @@ def sample_list_sinks(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_sinks] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2033,7 +2033,7 @@ def sample_get_sink(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_sink] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2170,7 +2170,7 @@ def sample_create_sink(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_sink] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2334,7 +2334,7 @@ def sample_update_sink(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_sink] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2438,7 +2438,7 @@ def sample_delete_sink(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_sink] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2573,7 +2573,7 @@ def sample_create_link(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_link] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2701,7 +2701,7 @@ def sample_delete_link(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_link] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2819,7 +2819,7 @@ def sample_list_links(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_links] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2935,7 +2935,7 @@ def sample_get_link(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_link] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3047,7 +3047,7 @@ def sample_list_exclusions(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_exclusions] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3174,7 +3174,7 @@ def sample_get_exclusion(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_exclusion] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3310,7 +3310,7 @@ def sample_create_exclusion(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_exclusion] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3460,7 +3460,7 @@ def sample_update_exclusion(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_exclusion] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3563,7 +3563,7 @@ def sample_delete_exclusion(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_exclusion] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3666,7 +3666,7 @@ def sample_get_cmek_settings(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_cmek_settings] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3777,7 +3777,7 @@ def sample_update_cmek_settings(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_cmek_settings] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -3911,7 +3911,7 @@ def sample_get_settings(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_settings] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -4055,7 +4055,7 @@ def sample_update_settings(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_settings] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py index 9d085d369e..083eb997b0 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py @@ -654,7 +654,7 @@ def sample_delete_log(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_log] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1196,7 +1196,7 @@ def sample_list_logs(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_logs] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py index 1fff39e085..41a2358568 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py @@ -657,7 +657,7 @@ def sample_list_log_metrics(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_log_metrics] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -782,7 +782,7 @@ def sample_get_log_metric(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_log_metric] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -915,7 +915,7 @@ def sample_create_log_metric(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_log_metric] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1047,7 +1047,7 @@ def sample_update_log_metric(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_log_metric] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1142,7 +1142,7 @@ def sample_delete_log_metric(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_log_metric] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index cc9aa5c883..14caa437d5 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -10954,8 +10954,11 @@ def test_list_buckets_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListBucketsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -10973,8 +10976,11 @@ def test_get_bucket_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -10992,8 +10998,11 @@ def test_create_bucket_async_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11011,8 +11020,11 @@ def test_update_bucket_async_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11030,8 +11042,11 @@ def test_create_bucket_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11049,8 +11064,11 @@ def test_update_bucket_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11068,8 +11086,11 @@ def test_delete_bucket_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11087,8 +11108,11 @@ def test_undelete_bucket_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UndeleteBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11106,8 +11130,11 @@ def test_list_views_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListViewsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11125,8 +11152,11 @@ def test_get_view_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11144,8 +11174,11 @@ def test_create_view_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11163,8 +11196,11 @@ def test_update_view_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11182,8 +11218,11 @@ def test_delete_view_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11201,8 +11240,11 @@ def test_list_sinks_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListSinksRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11220,8 +11262,11 @@ def test_get_sink_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11239,8 +11284,11 @@ def test_create_sink_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11258,8 +11306,11 @@ def test_update_sink_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11277,8 +11328,11 @@ def test_delete_sink_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11296,8 +11350,11 @@ def test_create_link_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11315,8 +11372,11 @@ def test_delete_link_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11334,8 +11394,11 @@ def test_list_links_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListLinksRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11353,8 +11416,11 @@ def test_get_link_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11372,8 +11438,11 @@ def test_list_exclusions_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListExclusionsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11391,8 +11460,11 @@ def test_get_exclusion_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11410,8 +11482,11 @@ def test_create_exclusion_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11429,8 +11504,11 @@ def test_update_exclusion_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11448,8 +11526,11 @@ def test_delete_exclusion_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11467,8 +11548,11 @@ def test_get_cmek_settings_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetCmekSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11486,8 +11570,11 @@ def test_update_cmek_settings_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateCmekSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11505,8 +11592,11 @@ def test_get_settings_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11524,8 +11614,11 @@ def test_update_settings_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11543,8 +11636,10 @@ def test_copy_log_entries_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CopyLogEntriesRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -11574,8 +11669,11 @@ async def test_list_buckets_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListBucketsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11603,8 +11701,11 @@ async def test_get_bucket_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11626,8 +11727,11 @@ async def test_create_bucket_async_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11649,8 +11753,11 @@ async def test_update_bucket_async_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11678,8 +11785,11 @@ async def test_create_bucket_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11707,8 +11817,11 @@ async def test_update_bucket_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11728,8 +11841,11 @@ async def test_delete_bucket_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11749,8 +11865,11 @@ async def test_undelete_bucket_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UndeleteBucketRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11772,8 +11891,11 @@ async def test_list_views_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListViewsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11797,8 +11919,11 @@ async def test_get_view_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11822,8 +11947,11 @@ async def test_create_view_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11847,8 +11975,11 @@ async def test_update_view_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11868,8 +11999,11 @@ async def test_delete_view_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteViewRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11891,8 +12025,11 @@ async def test_list_sinks_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListSinksRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11921,8 +12058,11 @@ async def test_get_sink_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11951,8 +12091,11 @@ async def test_create_sink_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11981,8 +12124,11 @@ async def test_update_sink_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12002,8 +12148,11 @@ async def test_delete_sink_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteSinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12025,8 +12174,11 @@ async def test_create_link_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12048,8 +12200,11 @@ async def test_delete_link_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12071,8 +12226,11 @@ async def test_list_links_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListLinksRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12096,8 +12254,11 @@ async def test_get_link_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetLinkRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12119,8 +12280,11 @@ async def test_list_exclusions_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListExclusionsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12145,8 +12309,11 @@ async def test_get_exclusion_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12171,8 +12338,11 @@ async def test_create_exclusion_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12197,8 +12367,11 @@ async def test_update_exclusion_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12218,8 +12391,11 @@ async def test_delete_exclusion_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteExclusionRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12244,8 +12420,11 @@ async def test_get_cmek_settings_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetCmekSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12270,8 +12449,11 @@ async def test_update_cmek_settings_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateCmekSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12297,8 +12479,11 @@ async def test_get_settings_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12324,8 +12509,11 @@ async def test_update_settings_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSettingsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12347,8 +12535,10 @@ async def test_copy_log_entries_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CopyLogEntriesRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 488d153e70..f2fff8a464 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -2913,8 +2913,11 @@ def test_delete_log_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.DeleteLogRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2932,8 +2935,11 @@ def test_write_log_entries_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.WriteLogEntriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2951,8 +2957,11 @@ def test_list_log_entries_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogEntriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2970,8 +2979,11 @@ def test_list_monitored_resource_descriptors_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListMonitoredResourceDescriptorsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2989,8 +3001,10 @@ def test_list_logs_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogsRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -3018,8 +3032,11 @@ async def test_delete_log_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.DeleteLogRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3040,8 +3057,11 @@ async def test_write_log_entries_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.WriteLogEntriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3063,8 +3083,11 @@ async def test_list_log_entries_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogEntriesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3086,8 +3109,11 @@ async def test_list_monitored_resource_descriptors_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListMonitoredResourceDescriptorsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3110,8 +3136,10 @@ async def test_list_logs_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogsRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index a23798d3b2..13f7bebff3 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -2703,8 +2703,11 @@ def test_list_log_metrics_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.ListLogMetricsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2722,8 +2725,11 @@ def test_get_log_metric_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.GetLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2741,8 +2747,11 @@ def test_create_log_metric_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.CreateLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2760,8 +2769,11 @@ def test_update_log_metric_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.UpdateLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2779,8 +2791,10 @@ def test_delete_log_metric_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.DeleteLogMetricRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -2810,8 +2824,11 @@ async def test_list_log_metrics_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.ListLogMetricsRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2839,8 +2856,11 @@ async def test_get_log_metric_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.GetLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2868,8 +2888,11 @@ async def test_create_log_metric_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.CreateLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2897,8 +2920,11 @@ async def test_update_log_metric_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.UpdateLogMetricRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2918,8 +2944,10 @@ async def test_delete_log_metric_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.DeleteLogMetricRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py index 2771c20739..d06e6a56eb 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py @@ -696,7 +696,7 @@ def sample_list_instances(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list_instances] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -808,7 +808,7 @@ def sample_get_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -912,7 +912,7 @@ def sample_get_instance_auth_string(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_instance_auth_string] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1068,7 +1068,7 @@ def sample_create_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.create_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1213,7 +1213,7 @@ def sample_update_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1343,7 +1343,7 @@ def sample_upgrade_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.upgrade_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1483,7 +1483,7 @@ def sample_import_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.import_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1620,7 +1620,7 @@ def sample_export_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.export_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1751,7 +1751,7 @@ def sample_failover_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.failover_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -1877,7 +1877,7 @@ def sample_delete_instance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete_instance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( @@ -2018,7 +2018,7 @@ def sample_reschedule_maintenance(): # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.reschedule_maintenance] - # Certain fields should be provided within the metadata header; + # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index 31bac5173e..81329eda2c 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -7937,8 +7937,11 @@ def test_list_instances_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7956,8 +7959,11 @@ def test_get_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7975,8 +7981,11 @@ def test_get_instance_auth_string_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7994,8 +8003,11 @@ def test_create_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8013,8 +8025,11 @@ def test_update_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8032,8 +8047,11 @@ def test_upgrade_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8051,8 +8069,11 @@ def test_import_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8070,8 +8091,11 @@ def test_export_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8089,8 +8113,11 @@ def test_failover_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8108,8 +8135,11 @@ def test_delete_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8127,8 +8157,10 @@ def test_reschedule_maintenance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -8159,8 +8191,11 @@ async def test_list_instances_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8208,8 +8243,11 @@ async def test_get_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8231,8 +8269,11 @@ async def test_get_instance_auth_string_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8254,8 +8295,11 @@ async def test_create_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8277,8 +8321,11 @@ async def test_update_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8300,8 +8347,11 @@ async def test_upgrade_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8323,8 +8373,11 @@ async def test_import_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8346,8 +8399,11 @@ async def test_export_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8369,8 +8425,11 @@ async def test_failover_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8392,8 +8451,11 @@ async def test_delete_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8415,8 +8477,10 @@ async def test_reschedule_maintenance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): @@ -8442,8 +8506,11 @@ def test_list_instances_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8461,8 +8528,11 @@ def test_get_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8480,8 +8550,11 @@ def test_get_instance_auth_string_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8499,8 +8572,11 @@ def test_create_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8518,8 +8594,11 @@ def test_update_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8537,8 +8616,11 @@ def test_upgrade_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8556,8 +8638,11 @@ def test_import_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8575,8 +8660,11 @@ def test_export_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8594,8 +8682,11 @@ def test_failover_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8613,8 +8704,11 @@ def test_delete_instance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8632,8 +8726,10 @@ def test_reschedule_maintenance_empty_call(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_kind_rest_asyncio(): @@ -8664,8 +8760,11 @@ async def test_list_instances_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8713,8 +8812,11 @@ async def test_get_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8736,8 +8838,11 @@ async def test_get_instance_auth_string_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8759,8 +8864,11 @@ async def test_create_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8782,8 +8890,11 @@ async def test_update_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8805,8 +8916,11 @@ async def test_upgrade_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8828,8 +8942,11 @@ async def test_import_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8851,8 +8968,11 @@ async def test_export_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8874,8 +8994,11 @@ async def test_failover_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8897,8 +9020,11 @@ async def test_delete_instance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8920,8 +9046,10 @@ async def test_reschedule_maintenance_empty_call_async(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): From fd74cbc1486b37bc9572e027426d2ba69326a820 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 8 Sep 2024 23:51:10 +0000 Subject: [PATCH 10/23] test: improve routing parameter assert --- gapic/schema/wrappers.py | 60 ++++++++++++++++++++++ tests/unit/schema/wrappers/test_routing.py | 54 +++++++++---------- 2 files changed, 85 insertions(+), 29 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index fd75e8fd5e..0a54e09b19 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1067,6 +1067,66 @@ def try_parse_routing_rule(cls, routing_rule: routing_pb2.RoutingRule) -> Option params = [RoutingParameter(x.field, x.path_template) for x in params] return cls(params) + @classmethod + def resolve(cls, routing_rule: routing_pb2.RoutingRule, request: Union[dict, str]) -> dict: + """Resolves the routing header which should be sent along with the request. + This function performs dynamic header resolution, identical to what's in `client.py.j2`. + The routing header is determined based on the given routing rule and request. + See the following link for more information on explicit routing headers: + https://google.aip.dev/client-libraries/4222#explicit-routing-headers-googleapirouting + + Args: + routing_rule(routing_pb2.RoutingRule): A collection of Routing Parameter specifications + defined by `routing_pb2.RoutingRule`. + See https://github.com/googleapis/googleapis/blob/cb39bdd75da491466f6c92bc73cd46b0fbd6ba9a/google/api/routing.proto#L391 + request(Union[dict, str]): The request for which the routine rule should be resolved. + The format can be either a dictionary or json string representing the request. + + Returns(dict): + A dictionary containing the resolved routing header to the sent along with the given request. + """ + + def _get_field(request, field_path: str): + segments = field_path.split(".") + + # Either json string or dictionary is supported + if isinstance(request, str): + current = json.loads(request) + else: + current = request + + # This is to cater for the case where the `field_path` contains a + # dot-separated path of field names leading to a field in a sub-message. + for x in segments: + current = current.get(x, None) + # Break if the sub-message does not exist + if current is None: + break + return current + + header_params = {} + for routing_param in routing_rule.routing_parameters: + request_field_value = _get_field(request, routing_param.field) + # Only resolve the header for routing parameter fields which are populated in the request + if request_field_value is not None: + # If there is a path_template for a given routing parameter field, the value of the field must match + # If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + if routing_param.path_template: + routing_param_regex = routing_param.to_regex() + regex_match = routing_param_regex.match( + request_field_value + ) + if regex_match: + header_params[routing_param.key] = regex_match.group( + routing_param.key + ) + else: # No need to match + header_params[routing_param.key] = request_field_value + return header_params + @dataclasses.dataclass(frozen=True) class HttpRule: diff --git a/tests/unit/schema/wrappers/test_routing.py b/tests/unit/schema/wrappers/test_routing.py index f93d6680a0..f4e6215bca 100644 --- a/tests/unit/schema/wrappers/test_routing.py +++ b/tests/unit/schema/wrappers/test_routing.py @@ -14,6 +14,7 @@ from gapic.schema import wrappers +import json import proto import pytest @@ -23,31 +24,6 @@ class RoutingTestRequest(proto.Message): app_profile_id = proto.Field(proto.STRING, number=2) -def resolve(rule, request): - """This function performs dynamic header resolution, identical to what's in client.py.j2.""" - - def _get_field(request, field_path: str): - segments = field_path.split(".") - cur = request - for x in segments: - cur = getattr(cur, x) - return cur - - header_params = {} - for routing_param in rule.routing_parameters: - # This may raise exception (which we show to clients). - request_field_value = _get_field(request, routing_param.field) - if routing_param.path_template: - routing_param_regex = routing_param.to_regex() - regex_match = routing_param_regex.match(request_field_value) - if regex_match: - header_params[routing_param.key] = regex_match.group( - routing_param.key) - else: # No need to match - header_params[routing_param.key] = request_field_value - return header_params - - @pytest.mark.parametrize( "req, expected", [ @@ -63,7 +39,10 @@ def _get_field(request, field_path: str): def test_routing_rule_resolve_simple_extraction(req, expected): rule = wrappers.RoutingRule( [wrappers.RoutingParameter("app_profile_id", "")]) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -82,7 +61,10 @@ def test_routing_rule_resolve_rename_extraction(req, expected): rule = wrappers.RoutingRule( [wrappers.RoutingParameter("app_profile_id", "{routing_id=**}")] ) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -111,7 +93,10 @@ def test_routing_rule_resolve_field_match(req, expected): ), ] ) - assert resolve(rule, req) == expected + assert wrappers.RoutingRule.resolve( + rule, + RoutingTestRequest.to_dict(req) + ) == expected @pytest.mark.parametrize( @@ -135,6 +120,9 @@ def test_routing_rule_resolve_field_match(req, expected): wrappers.RoutingParameter( "table_name", "projects/*/{instance_id=instances/*}/**" ), + wrappers.RoutingParameter( + "doesnotexist", "projects/*/{instance_id=instances/*}/**" + ), ], RoutingTestRequest( table_name="projects/100/instances/200/tables/300"), @@ -144,7 +132,15 @@ def test_routing_rule_resolve_field_match(req, expected): ) def test_routing_rule_resolve(routing_parameters, req, expected): rule = wrappers.RoutingRule(routing_parameters) - got = resolve(rule, req) + got = wrappers.RoutingRule.resolve( + rule, RoutingTestRequest.to_dict(req) + ) + assert got == expected + + rule = wrappers.RoutingRule(routing_parameters) + got = wrappers.RoutingRule.resolve( + rule, json.dumps(RoutingTestRequest.to_dict(req)) + ) assert got == expected From fb0f9f4ad525581ae2484d962ced9db8c6f3458b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 07:51:20 -0400 Subject: [PATCH 11/23] Reviewer suggested edit Co-authored-by: Victor Chudnovsky --- gapic/schema/wrappers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index 0a54e09b19..e14df9c9c4 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1110,10 +1110,10 @@ def _get_field(request, field_path: str): # Only resolve the header for routing parameter fields which are populated in the request if request_field_value is not None: # If there is a path_template for a given routing parameter field, the value of the field must match - # If multiple Routing Parameters describe the same key + # If multiple `routing_param`s describe the same key # (via the `path_template` field or via the `field` field when - # `path_template` is not provided), "last one wins" rule - # determines which Parameter gets used. + # `path_template` is not provided), the "last one wins" rule + # determines which parameter gets used. See https://google.aip.dev/client-libraries/4222. if routing_param.path_template: routing_param_regex = routing_param.to_regex() regex_match = routing_param_regex.match( From f0ffb4c8f7e0a0adbaeb24c2f94c8807c7b82698 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 12:23:29 +0000 Subject: [PATCH 12/23] optimize calls to RoutingParameter.to_regex --- gapic/schema/wrappers.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index e14df9c9c4..9ffb7e449f 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -30,6 +30,7 @@ import collections import copy import dataclasses +import functools import json import keyword import re @@ -54,6 +55,12 @@ from gapic.utils import uri_sample +# This is the value for the `maxsize` argument of @functools.lru_cache +# https://docs.python.org/3/library/functools.html#functools.lru_cache +# This represents the number of recent function calls to store. +ROUTING_PARAM_REGEX_CACHE_SIZE = 32 + + @dataclasses.dataclass(frozen=True) class Field: """Description of a field.""" @@ -1035,6 +1042,8 @@ def _to_regex(self, path_template: str) -> Pattern: """ return re.compile(f"^{self._convert_to_regex(path_template)}$") + # Use caching to avoid repeated computation + @functools.lru_cache(maxsize=ROUTING_PARAM_REGEX_CACHE_SIZE) def to_regex(self) -> Pattern: return self._to_regex(self.path_template) @@ -1114,17 +1123,18 @@ def _get_field(request, field_path: str): # (via the `path_template` field or via the `field` field when # `path_template` is not provided), the "last one wins" rule # determines which parameter gets used. See https://google.aip.dev/client-libraries/4222. + routing_parameter_key = routing_param.key if routing_param.path_template: routing_param_regex = routing_param.to_regex() regex_match = routing_param_regex.match( request_field_value ) if regex_match: - header_params[routing_param.key] = regex_match.group( - routing_param.key + header_params[routing_parameter_key] = regex_match.group( + routing_parameter_key ) else: # No need to match - header_params[routing_param.key] = request_field_value + header_params[routing_parameter_key] = request_field_value return header_params From 1227c7c90851ad833030840c286ee3f841f6c3b3 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 12:34:05 +0000 Subject: [PATCH 13/23] @functools.lru_cache->@functools.cache --- gapic/schema/wrappers.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index 9ffb7e449f..3279abc675 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -55,12 +55,6 @@ from gapic.utils import uri_sample -# This is the value for the `maxsize` argument of @functools.lru_cache -# https://docs.python.org/3/library/functools.html#functools.lru_cache -# This represents the number of recent function calls to store. -ROUTING_PARAM_REGEX_CACHE_SIZE = 32 - - @dataclasses.dataclass(frozen=True) class Field: """Description of a field.""" @@ -1043,7 +1037,8 @@ def _to_regex(self, path_template: str) -> Pattern: return re.compile(f"^{self._convert_to_regex(path_template)}$") # Use caching to avoid repeated computation - @functools.lru_cache(maxsize=ROUTING_PARAM_REGEX_CACHE_SIZE) + # https://docs.python.org/3/library/functools.html#functools.cache + @functools.cache def to_regex(self) -> Pattern: return self._to_regex(self.path_template) From e50bbd6921ba3dc112c5c625c5f16fc7d7f6f57c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 12:36:05 +0000 Subject: [PATCH 14/23] optimize calls to RoutingParameter.key --- gapic/schema/wrappers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index 3279abc675..c7633f3ce6 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1043,6 +1043,9 @@ def to_regex(self) -> Pattern: return self._to_regex(self.path_template) @property + # Use caching to avoid repeated computation + # https://docs.python.org/3/library/functools.html#functools.cache + @functools.cache def key(self) -> Union[str, None]: if self.path_template == "": return self.field From 5b9dbb32cbf9ed77faf2919209810d1508b69e4f Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 13:03:18 +0000 Subject: [PATCH 15/23] update comment --- gapic/schema/wrappers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index c7633f3ce6..82ddc5e0e1 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1077,7 +1077,8 @@ def try_parse_routing_rule(cls, routing_rule: routing_pb2.RoutingRule) -> Option @classmethod def resolve(cls, routing_rule: routing_pb2.RoutingRule, request: Union[dict, str]) -> dict: """Resolves the routing header which should be sent along with the request. - This function performs dynamic header resolution, identical to what's in `client.py.j2`. + This function performs dynamic header resolution, identical to what's in `_client_macros.j2`. + https://github.com/googleapis/gapic-generator-python/blob/4c5de8791795f8101f6ec66f80b8a8e5e9a21822/gapic/templates/%25namespace/%25name_%25version/%25sub/services/%25service/_client_macros.j2#L150-L164 The routing header is determined based on the given routing rule and request. See the following link for more information on explicit routing headers: https://google.aip.dev/client-libraries/4222#explicit-routing-headers-googleapirouting From c3c683f64a1413a8dd8714ceda3b75d55123420b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 13:11:23 +0000 Subject: [PATCH 16/23] revert back to @functools.lru_cache --- gapic/schema/wrappers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index 82ddc5e0e1..5ce3e6bc37 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1037,15 +1037,19 @@ def _to_regex(self, path_template: str) -> Pattern: return re.compile(f"^{self._convert_to_regex(path_template)}$") # Use caching to avoid repeated computation + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2161): + # Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped. # https://docs.python.org/3/library/functools.html#functools.cache - @functools.cache + @functools.lru_cache(max_size=None) def to_regex(self) -> Pattern: return self._to_regex(self.path_template) @property # Use caching to avoid repeated computation + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2161): + # Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped. # https://docs.python.org/3/library/functools.html#functools.cache - @functools.cache + @functools.lru_cache(max_size=None) def key(self) -> Union[str, None]: if self.path_template == "": return self.field From dd28fce72699461a53302df15bc1fed054cb025b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 14 Sep 2024 13:15:02 +0000 Subject: [PATCH 17/23] fix build --- gapic/schema/wrappers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gapic/schema/wrappers.py b/gapic/schema/wrappers.py index 5ce3e6bc37..03466124f5 100644 --- a/gapic/schema/wrappers.py +++ b/gapic/schema/wrappers.py @@ -1040,7 +1040,7 @@ def _to_regex(self, path_template: str) -> Pattern: # TODO(https://github.com/googleapis/gapic-generator-python/issues/2161): # Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped. # https://docs.python.org/3/library/functools.html#functools.cache - @functools.lru_cache(max_size=None) + @functools.lru_cache(maxsize=None) def to_regex(self) -> Pattern: return self._to_regex(self.path_template) @@ -1049,7 +1049,7 @@ def to_regex(self) -> Pattern: # TODO(https://github.com/googleapis/gapic-generator-python/issues/2161): # Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped. # https://docs.python.org/3/library/functools.html#functools.cache - @functools.lru_cache(max_size=None) + @functools.lru_cache(maxsize=None) def key(self) -> Union[str, None]: if self.path_template == "": return self.field From 9eaa5b61bf933fc19e0bf61bcaadee8149fb0b2b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 15 Sep 2024 14:15:13 +0000 Subject: [PATCH 18/23] fix build --- .../gapic/%name_%version/%sub/test_macros.j2 | 2 +- .../unit/gapic/asset_v1/test_asset_service.py | 276 ++++++++----- .../credentials_v1/test_iam_credentials.py | 48 ++- .../unit/gapic/eventarc_v1/test_eventarc.py | 216 ++++++---- .../logging_v2/test_config_service_v2.py | 384 ++++++++++++------ .../logging_v2/test_logging_service_v2.py | 60 ++- .../logging_v2/test_metrics_service_v2.py | 60 ++- .../unit/gapic/redis_v1/test_cloud_redis.py | 132 ++++-- 8 files changed, 785 insertions(+), 393 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 08f0f72242..683b888120 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1890,7 +1890,7 @@ def test_transport_kind_{{ transport_name }}(): {# Any value that is part of the HTTP/1.1 URI should be sent as #} {# a field header. Set these to a non-empty value. #} {% for routing_param in method.routing_rule.routing_parameters %} -{{ method_call_test("routing_parameters_request_" + loop.index|string, method, service, api, request_dict=routing_param.sample_request,is_async=is_async) }} +{{ method_call_test_generic("routing_parameters_request_" + loop.index|string, method, service, api, transport, request_dict=routing_param.sample_request,is_async=is_async) }} {% endfor %}{# routing_param in method.routing_rule.routing_parameters #} {% endif %}{# method.explicit_routing #} {% endfor %}{# method in service.methods.values() #} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 268e14d432..798f926f38 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -15448,8 +15448,10 @@ def test_export_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ExportAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15467,8 +15469,10 @@ def test_list_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15486,8 +15490,10 @@ def test_batch_get_assets_history_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetAssetsHistoryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15505,8 +15511,10 @@ def test_create_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15524,8 +15532,10 @@ def test_get_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15543,8 +15553,10 @@ def test_list_feeds_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListFeedsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15562,8 +15574,10 @@ def test_update_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15581,8 +15595,10 @@ def test_delete_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15600,8 +15616,10 @@ def test_search_all_resources_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllResourcesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15619,8 +15637,10 @@ def test_search_all_iam_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllIamPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15638,8 +15658,10 @@ def test_analyze_iam_policy_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15657,8 +15679,10 @@ def test_analyze_iam_policy_longrunning_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15676,8 +15700,10 @@ def test_analyze_move_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeMoveRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15695,8 +15721,10 @@ def test_query_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.QueryAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15714,8 +15742,10 @@ def test_create_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15733,8 +15763,10 @@ def test_get_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15752,8 +15784,10 @@ def test_list_saved_queries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListSavedQueriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15771,8 +15805,10 @@ def test_update_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15790,8 +15826,10 @@ def test_delete_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15809,8 +15847,10 @@ def test_batch_get_effective_iam_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15828,8 +15868,10 @@ def test_analyze_org_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15847,8 +15889,10 @@ def test_analyze_org_policy_governed_containers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15866,8 +15910,10 @@ def test_analyze_org_policy_governed_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -15897,8 +15943,10 @@ async def test_export_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ExportAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ExportAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15920,8 +15968,10 @@ async def test_list_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15942,8 +15992,10 @@ async def test_batch_get_assets_history_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetAssetsHistoryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetAssetsHistoryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15969,8 +16021,10 @@ async def test_create_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -15996,8 +16050,10 @@ async def test_get_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16018,8 +16074,10 @@ async def test_list_feeds_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListFeedsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListFeedsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16045,8 +16103,10 @@ async def test_update_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16066,8 +16126,10 @@ async def test_delete_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteFeedRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteFeedRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16089,8 +16151,10 @@ async def test_search_all_resources_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllResourcesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllResourcesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16112,8 +16176,10 @@ async def test_search_all_iam_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.SearchAllIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.SearchAllIamPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16135,8 +16201,10 @@ async def test_analyze_iam_policy_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16158,8 +16226,10 @@ async def test_analyze_iam_policy_longrunning_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeIamPolicyLongrunningRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16180,8 +16250,10 @@ async def test_analyze_move_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeMoveRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeMoveRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16204,8 +16276,10 @@ async def test_query_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.QueryAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.QueryAssetsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16230,8 +16304,10 @@ async def test_create_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.CreateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.CreateSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16256,8 +16332,10 @@ async def test_get_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.GetSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.GetSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16279,8 +16357,10 @@ async def test_list_saved_queries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.ListSavedQueriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.ListSavedQueriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16305,8 +16385,10 @@ async def test_update_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.UpdateSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.UpdateSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16326,8 +16408,10 @@ async def test_delete_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.DeleteSavedQueryRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.DeleteSavedQueryRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16348,8 +16432,10 @@ async def test_batch_get_effective_iam_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.BatchGetEffectiveIamPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16371,8 +16457,10 @@ async def test_analyze_org_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPoliciesRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPoliciesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16394,8 +16482,10 @@ async def test_analyze_org_policy_governed_containers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -16417,8 +16507,10 @@ async def test_analyze_org_policy_governed_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + _, args, kw = call.mock_calls[0] + request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index ee56784e86..d0e1c9b779 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -3343,8 +3343,10 @@ def test_generate_access_token_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateAccessTokenRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3362,8 +3364,10 @@ def test_generate_id_token_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateIdTokenRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3381,8 +3385,10 @@ def test_sign_blob_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignBlobRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3400,8 +3406,10 @@ def test_sign_jwt_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignJwtRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -3431,8 +3439,10 @@ async def test_generate_access_token_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateAccessTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateAccessTokenRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3454,8 +3464,10 @@ async def test_generate_id_token_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.GenerateIdTokenRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.GenerateIdTokenRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3478,8 +3490,10 @@ async def test_sign_blob_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignBlobRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignBlobRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3502,8 +3516,10 @@ async def test_sign_jwt_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == common.SignJwtRequest() + _, args, kw = call.mock_calls[0] + request_msg = common.SignJwtRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index 54f7efa890..b3b51c9516 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -13085,8 +13085,10 @@ def test_get_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13104,8 +13106,10 @@ def test_list_triggers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListTriggersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13123,8 +13127,10 @@ def test_create_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13142,8 +13148,10 @@ def test_update_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13161,8 +13169,10 @@ def test_delete_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13180,8 +13190,10 @@ def test_get_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13199,8 +13211,10 @@ def test_list_channels_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13218,8 +13232,10 @@ def test_create_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13237,8 +13253,10 @@ def test_update_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13256,8 +13274,10 @@ def test_delete_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13275,8 +13295,10 @@ def test_get_provider_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetProviderRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13294,8 +13316,10 @@ def test_list_providers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListProvidersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13313,8 +13337,10 @@ def test_get_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13332,8 +13358,10 @@ def test_list_channel_connections_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelConnectionsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13351,8 +13379,10 @@ def test_create_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13370,8 +13400,10 @@ def test_delete_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13389,8 +13421,10 @@ def test_get_google_channel_config_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetGoogleChannelConfigRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13408,8 +13442,10 @@ def test_update_google_channel_config_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateGoogleChannelConfigRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -13443,8 +13479,10 @@ async def test_get_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13467,8 +13505,10 @@ async def test_list_triggers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListTriggersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListTriggersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13490,8 +13530,10 @@ async def test_create_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13513,8 +13555,10 @@ async def test_update_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13536,8 +13580,10 @@ async def test_delete_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteTriggerRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteTriggerRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13564,8 +13610,10 @@ async def test_get_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13588,8 +13636,10 @@ async def test_list_channels_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13611,8 +13661,10 @@ async def test_create_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13634,8 +13686,10 @@ async def test_update_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13657,8 +13711,10 @@ async def test_delete_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13681,8 +13737,10 @@ async def test_get_provider_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetProviderRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetProviderRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13705,8 +13763,10 @@ async def test_list_providers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListProvidersRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListProvidersRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13731,8 +13791,10 @@ async def test_get_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13755,8 +13817,10 @@ async def test_list_channel_connections_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.ListChannelConnectionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.ListChannelConnectionsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13778,8 +13842,10 @@ async def test_create_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.CreateChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.CreateChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13801,8 +13867,10 @@ async def test_delete_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.DeleteChannelConnectionRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.DeleteChannelConnectionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13825,8 +13893,10 @@ async def test_get_google_channel_config_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.GetGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.GetGoogleChannelConfigRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -13849,8 +13919,10 @@ async def test_update_google_channel_config_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == eventarc.UpdateGoogleChannelConfigRequest() + _, args, kw = call.mock_calls[0] + request_msg = eventarc.UpdateGoogleChannelConfigRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index e1709e17ed..4fa16b166d 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -10954,8 +10954,10 @@ def test_list_buckets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListBucketsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -10973,8 +10975,10 @@ def test_get_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -10992,8 +10996,10 @@ def test_create_bucket_async_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11011,8 +11017,10 @@ def test_update_bucket_async_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11030,8 +11038,10 @@ def test_create_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11049,8 +11059,10 @@ def test_update_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11068,8 +11080,10 @@ def test_delete_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11087,8 +11101,10 @@ def test_undelete_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UndeleteBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11106,8 +11122,10 @@ def test_list_views_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListViewsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11125,8 +11143,10 @@ def test_get_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11144,8 +11164,10 @@ def test_create_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11163,8 +11185,10 @@ def test_update_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11182,8 +11206,10 @@ def test_delete_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11201,8 +11227,10 @@ def test_list_sinks_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListSinksRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11220,8 +11248,10 @@ def test_get_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11239,8 +11269,10 @@ def test_create_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11258,8 +11290,10 @@ def test_update_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11277,8 +11311,10 @@ def test_delete_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11296,8 +11332,10 @@ def test_create_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11315,8 +11353,10 @@ def test_delete_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11334,8 +11374,10 @@ def test_list_links_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListLinksRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11353,8 +11395,10 @@ def test_get_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11372,8 +11416,10 @@ def test_list_exclusions_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListExclusionsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11391,8 +11437,10 @@ def test_get_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11410,8 +11458,10 @@ def test_create_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11429,8 +11479,10 @@ def test_update_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11448,8 +11500,10 @@ def test_delete_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11467,8 +11521,10 @@ def test_get_cmek_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetCmekSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11486,8 +11542,10 @@ def test_update_cmek_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateCmekSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11505,8 +11563,10 @@ def test_get_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11524,8 +11584,10 @@ def test_update_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11543,8 +11605,10 @@ def test_copy_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CopyLogEntriesRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -11574,8 +11638,10 @@ async def test_list_buckets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListBucketsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListBucketsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11603,8 +11669,10 @@ async def test_get_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11626,8 +11694,10 @@ async def test_create_bucket_async_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11649,8 +11719,10 @@ async def test_update_bucket_async_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11678,8 +11750,10 @@ async def test_create_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11707,8 +11781,10 @@ async def test_update_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11728,8 +11804,10 @@ async def test_delete_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11749,8 +11827,10 @@ async def test_undelete_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UndeleteBucketRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UndeleteBucketRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11772,8 +11852,10 @@ async def test_list_views_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListViewsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListViewsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11797,8 +11879,10 @@ async def test_get_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11822,8 +11906,10 @@ async def test_create_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11847,8 +11933,10 @@ async def test_update_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11868,8 +11956,10 @@ async def test_delete_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteViewRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteViewRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11891,8 +11981,10 @@ async def test_list_sinks_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListSinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListSinksRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11921,8 +12013,10 @@ async def test_get_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11951,8 +12045,10 @@ async def test_create_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -11981,8 +12077,10 @@ async def test_update_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12002,8 +12100,10 @@ async def test_delete_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteSinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteSinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12025,8 +12125,10 @@ async def test_create_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12048,8 +12150,10 @@ async def test_delete_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12071,8 +12175,10 @@ async def test_list_links_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListLinksRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListLinksRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12096,8 +12202,10 @@ async def test_get_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetLinkRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetLinkRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12119,8 +12227,10 @@ async def test_list_exclusions_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.ListExclusionsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.ListExclusionsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12145,8 +12255,10 @@ async def test_get_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12171,8 +12283,10 @@ async def test_create_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CreateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CreateExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12197,8 +12311,10 @@ async def test_update_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12218,8 +12334,10 @@ async def test_delete_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.DeleteExclusionRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.DeleteExclusionRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12244,8 +12362,10 @@ async def test_get_cmek_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetCmekSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12270,8 +12390,10 @@ async def test_update_cmek_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateCmekSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateCmekSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12297,8 +12419,10 @@ async def test_get_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.GetSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.GetSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12324,8 +12448,10 @@ async def test_update_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.UpdateSettingsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.UpdateSettingsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -12347,8 +12473,10 @@ async def test_copy_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_config.CopyLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_config.CopyLogEntriesRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 72d12df2f5..3e194557b0 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -2913,8 +2913,10 @@ def test_delete_log_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.DeleteLogRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2932,8 +2934,10 @@ def test_write_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.WriteLogEntriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2951,8 +2955,10 @@ def test_list_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogEntriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2970,8 +2976,10 @@ def test_list_monitored_resource_descriptors_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListMonitoredResourceDescriptorsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2989,8 +2997,10 @@ def test_list_logs_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogsRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -3018,8 +3028,10 @@ async def test_delete_log_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.DeleteLogRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.DeleteLogRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3040,8 +3052,10 @@ async def test_write_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.WriteLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.WriteLogEntriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3063,8 +3077,10 @@ async def test_list_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogEntriesRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogEntriesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3086,8 +3102,10 @@ async def test_list_monitored_resource_descriptors_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListMonitoredResourceDescriptorsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListMonitoredResourceDescriptorsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3110,8 +3128,10 @@ async def test_list_logs_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging.ListLogsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging.ListLogsRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index 7555ad73a7..a01c1fd5e7 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -2703,8 +2703,10 @@ def test_list_log_metrics_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.ListLogMetricsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2722,8 +2724,10 @@ def test_get_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.GetLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2741,8 +2745,10 @@ def test_create_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.CreateLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2760,8 +2766,10 @@ def test_update_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.UpdateLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2779,8 +2787,10 @@ def test_delete_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.DeleteLogMetricRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -2810,8 +2820,10 @@ async def test_list_log_metrics_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.ListLogMetricsRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.ListLogMetricsRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2839,8 +2851,10 @@ async def test_get_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.GetLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.GetLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2868,8 +2882,10 @@ async def test_create_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.CreateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.CreateLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2897,8 +2913,10 @@ async def test_update_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.UpdateLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.UpdateLogMetricRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2918,8 +2936,10 @@ async def test_delete_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == logging_metrics.DeleteLogMetricRequest() + _, args, kw = call.mock_calls[0] + request_msg = logging_metrics.DeleteLogMetricRequest() + + assert args[0] == request_msg def test_transport_grpc_default(): diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index b73b73a738..df42569a57 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -7937,8 +7937,10 @@ def test_list_instances_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7956,8 +7958,10 @@ def test_get_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7975,8 +7979,10 @@ def test_get_instance_auth_string_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -7994,8 +8000,10 @@ def test_create_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8013,8 +8021,10 @@ def test_update_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8032,8 +8042,10 @@ def test_upgrade_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8051,8 +8063,10 @@ def test_import_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8070,8 +8084,10 @@ def test_export_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8089,8 +8105,10 @@ def test_failover_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8108,8 +8126,10 @@ def test_delete_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8127,8 +8147,10 @@ def test_reschedule_maintenance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_kind_grpc_asyncio(): @@ -8159,8 +8181,10 @@ async def test_list_instances_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ListInstancesRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ListInstancesRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8208,8 +8232,10 @@ async def test_get_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8231,8 +8257,10 @@ async def test_get_instance_auth_string_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.GetInstanceAuthStringRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.GetInstanceAuthStringRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8254,8 +8282,10 @@ async def test_create_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.CreateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.CreateInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8277,8 +8307,10 @@ async def test_update_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpdateInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpdateInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8300,8 +8332,10 @@ async def test_upgrade_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.UpgradeInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.UpgradeInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8323,8 +8357,10 @@ async def test_import_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ImportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ImportInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8346,8 +8382,10 @@ async def test_export_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.ExportInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.ExportInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8369,8 +8407,10 @@ async def test_failover_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.FailoverInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.FailoverInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8392,8 +8432,10 @@ async def test_delete_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.DeleteInstanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.DeleteInstanceRequest() + + assert args[0] == request_msg # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -8415,8 +8457,10 @@ async def test_reschedule_maintenance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cloud_redis.RescheduleMaintenanceRequest() + _, args, kw = call.mock_calls[0] + request_msg = cloud_redis.RescheduleMaintenanceRequest() + + assert args[0] == request_msg def test_transport_kind_rest(): From ce152144fc4035e70b03d895a9f378eda21061fd Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 15 Sep 2024 14:54:54 +0000 Subject: [PATCH 19/23] restore assert --- .../gapic/%name_%version/%sub/test_macros.j2 | 9 +- .../unit/gapic/asset_v1/test_asset_service.py | 67 ++++++++----- .../credentials_v1/test_iam_credentials.py | 10 +- .../unit/gapic/eventarc_v1/test_eventarc.py | 52 +++++++---- .../logging_v2/test_config_service_v2.py | 93 ++++++++++++------- .../logging_v2/test_logging_service_v2.py | 10 +- .../logging_v2/test_metrics_service_v2.py | 13 ++- .../unit/gapic/redis_v1/test_cloud_redis.py | 31 ++++--- 8 files changed, 189 insertions(+), 96 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 8a9a49fc96..55fd01f1da 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1766,7 +1766,7 @@ def test_{{ method_name }}_rest_no_http_options(): creating a new macro with the name `method_call_test_` for the macro which supports a more customized method call. #} -{% macro method_call_test_generic(test_name, method, service, api, transport, request_dict, is_async=False) %} +{% macro method_call_test_generic(test_name, method, service, api, transport, request_dict, is_async=False, routing_param=None) %} {% set transport_name = get_transport_name(transport, is_async) %} {% with method_name = (method.name + ("_unary" if method.operation_service else "")) | snake_case %} {% set async_method_prefix = "async " if is_async else "" %} @@ -1839,6 +1839,11 @@ def test_{{ method_name }}_rest_no_http_options(): request_msg = {{ method.input.ident }}() {% endif %}{# request_dict #} assert args[0] == request_msg + + {% if routing_param %} + expected_headers = {{ method.routing_rule.resolve(method.routing_rule, routing_param.sample_request) }} + assert gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw['metadata'] + {% endif %} {% endwith %}{# method_name #} {% endmacro %} @@ -1889,7 +1894,7 @@ def test_transport_kind_{{ transport_name }}(): {# Any value that is part of the HTTP/1.1 URI should be sent as #} {# a field header. Set these to a non-empty value. #} {% for routing_param in method.routing_rule.routing_parameters %} -{{ method_call_test_generic("routing_parameters_request_" + loop.index|string, method, service, api, transport, request_dict=routing_param.sample_request,is_async=is_async) }} +{{ method_call_test_generic("routing_parameters_request_" + loop.index|string, method, service, api, transport, request_dict=routing_param.sample_request,is_async=is_async, routing_param=routing_param) }} {% endfor %}{# routing_param in method.routing_rule.routing_parameters #} {% endif %}{# method.explicit_routing #} {% endfor %}{# method in service.methods.values() #} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 798f926f38..a0849c32cf 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -953,7 +953,6 @@ async def test_export_assets_async(transport: str = 'grpc_asyncio', request_type async def test_export_assets_async_from_dict(): await test_export_assets_async(request_type=dict) - def test_export_assets_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1183,7 +1182,6 @@ async def test_list_assets_async(transport: str = 'grpc_asyncio', request_type=a async def test_list_assets_async_from_dict(): await test_list_assets_async(request_type=dict) - def test_list_assets_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1685,7 +1683,6 @@ async def test_batch_get_assets_history_async(transport: str = 'grpc_asyncio', r async def test_batch_get_assets_history_async_from_dict(): await test_batch_get_assets_history_async(request_type=dict) - def test_batch_get_assets_history_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1931,7 +1928,6 @@ async def test_create_feed_async(transport: str = 'grpc_asyncio', request_type=a async def test_create_feed_async_from_dict(): await test_create_feed_async(request_type=dict) - def test_create_feed_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2257,7 +2253,6 @@ async def test_get_feed_async(transport: str = 'grpc_asyncio', request_type=asse async def test_get_feed_async_from_dict(): await test_get_feed_async(request_type=dict) - def test_get_feed_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2563,7 +2558,6 @@ async def test_list_feeds_async(transport: str = 'grpc_asyncio', request_type=as async def test_list_feeds_async_from_dict(): await test_list_feeds_async(request_type=dict) - def test_list_feeds_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2887,7 +2881,6 @@ async def test_update_feed_async(transport: str = 'grpc_asyncio', request_type=a async def test_update_feed_async_from_dict(): await test_update_feed_async(request_type=dict) - def test_update_feed_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3191,7 +3184,6 @@ async def test_delete_feed_async(transport: str = 'grpc_asyncio', request_type=a async def test_delete_feed_async_from_dict(): await test_delete_feed_async(request_type=dict) - def test_delete_feed_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3507,7 +3499,6 @@ async def test_search_all_resources_async(transport: str = 'grpc_asyncio', reque async def test_search_all_resources_async_from_dict(): await test_search_all_resources_async(request_type=dict) - def test_search_all_resources_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4039,7 +4030,6 @@ async def test_search_all_iam_policies_async(transport: str = 'grpc_asyncio', re async def test_search_all_iam_policies_async_from_dict(): await test_search_all_iam_policies_async(request_type=dict) - def test_search_all_iam_policies_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4555,7 +4545,6 @@ async def test_analyze_iam_policy_async(transport: str = 'grpc_asyncio', request async def test_analyze_iam_policy_async_from_dict(): await test_analyze_iam_policy_async(request_type=dict) - def test_analyze_iam_policy_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4789,7 +4778,6 @@ async def test_analyze_iam_policy_longrunning_async(transport: str = 'grpc_async async def test_analyze_iam_policy_longrunning_async_from_dict(): await test_analyze_iam_policy_longrunning_async(request_type=dict) - def test_analyze_iam_policy_longrunning_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5015,7 +5003,6 @@ async def test_analyze_move_async(transport: str = 'grpc_asyncio', request_type= async def test_analyze_move_async_from_dict(): await test_analyze_move_async(request_type=dict) - def test_analyze_move_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5253,7 +5240,6 @@ async def test_query_assets_async(transport: str = 'grpc_asyncio', request_type= async def test_query_assets_async_from_dict(): await test_query_assets_async(request_type=dict) - def test_query_assets_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5495,7 +5481,6 @@ async def test_create_saved_query_async(transport: str = 'grpc_asyncio', request async def test_create_saved_query_async_from_dict(): await test_create_saved_query_async(request_type=dict) - def test_create_saved_query_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5837,7 +5822,6 @@ async def test_get_saved_query_async(transport: str = 'grpc_asyncio', request_ty async def test_get_saved_query_async_from_dict(): await test_get_saved_query_async(request_type=dict) - def test_get_saved_query_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6151,7 +6135,6 @@ async def test_list_saved_queries_async(transport: str = 'grpc_asyncio', request async def test_list_saved_queries_async_from_dict(): await test_list_saved_queries_async(request_type=dict) - def test_list_saved_queries_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6667,7 +6650,6 @@ async def test_update_saved_query_async(transport: str = 'grpc_asyncio', request async def test_update_saved_query_async_from_dict(): await test_update_saved_query_async(request_type=dict) - def test_update_saved_query_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6981,7 +6963,6 @@ async def test_delete_saved_query_async(transport: str = 'grpc_asyncio', request async def test_delete_saved_query_async_from_dict(): await test_delete_saved_query_async(request_type=dict) - def test_delete_saved_query_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -7287,7 +7268,6 @@ async def test_batch_get_effective_iam_policies_async(transport: str = 'grpc_asy async def test_batch_get_effective_iam_policies_async_from_dict(): await test_batch_get_effective_iam_policies_async(request_type=dict) - def test_batch_get_effective_iam_policies_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -7521,7 +7501,6 @@ async def test_analyze_org_policies_async(transport: str = 'grpc_asyncio', reque async def test_analyze_org_policies_async_from_dict(): await test_analyze_org_policies_async(request_type=dict) - def test_analyze_org_policies_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -8053,7 +8032,6 @@ async def test_analyze_org_policy_governed_containers_async(transport: str = 'gr async def test_analyze_org_policy_governed_containers_async_from_dict(): await test_analyze_org_policy_governed_containers_async(request_type=dict) - def test_analyze_org_policy_governed_containers_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -8585,7 +8563,6 @@ async def test_analyze_org_policy_governed_assets_async(transport: str = 'grpc_a async def test_analyze_org_policy_governed_assets_async_from_dict(): await test_analyze_org_policy_governed_assets_async(request_type=dict) - def test_analyze_org_policy_governed_assets_field_headers(): client = AssetServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -15453,6 +15430,7 @@ def test_export_assets_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_assets_empty_call_grpc(): @@ -15474,6 +15452,7 @@ def test_list_assets_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_batch_get_assets_history_empty_call_grpc(): @@ -15495,6 +15474,7 @@ def test_batch_get_assets_history_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_feed_empty_call_grpc(): @@ -15516,6 +15496,7 @@ def test_create_feed_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_feed_empty_call_grpc(): @@ -15537,6 +15518,7 @@ def test_get_feed_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_feeds_empty_call_grpc(): @@ -15558,6 +15540,7 @@ def test_list_feeds_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_feed_empty_call_grpc(): @@ -15579,6 +15562,7 @@ def test_update_feed_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_feed_empty_call_grpc(): @@ -15600,6 +15584,7 @@ def test_delete_feed_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_search_all_resources_empty_call_grpc(): @@ -15621,6 +15606,7 @@ def test_search_all_resources_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_search_all_iam_policies_empty_call_grpc(): @@ -15642,6 +15628,7 @@ def test_search_all_iam_policies_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_iam_policy_empty_call_grpc(): @@ -15663,6 +15650,7 @@ def test_analyze_iam_policy_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_iam_policy_longrunning_empty_call_grpc(): @@ -15684,6 +15672,7 @@ def test_analyze_iam_policy_longrunning_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_move_empty_call_grpc(): @@ -15705,6 +15694,7 @@ def test_analyze_move_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_query_assets_empty_call_grpc(): @@ -15726,6 +15716,7 @@ def test_query_assets_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_saved_query_empty_call_grpc(): @@ -15747,6 +15738,7 @@ def test_create_saved_query_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_saved_query_empty_call_grpc(): @@ -15768,6 +15760,7 @@ def test_get_saved_query_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_saved_queries_empty_call_grpc(): @@ -15789,6 +15782,7 @@ def test_list_saved_queries_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_saved_query_empty_call_grpc(): @@ -15810,6 +15804,7 @@ def test_update_saved_query_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_saved_query_empty_call_grpc(): @@ -15831,6 +15826,7 @@ def test_delete_saved_query_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_batch_get_effective_iam_policies_empty_call_grpc(): @@ -15852,6 +15848,7 @@ def test_batch_get_effective_iam_policies_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_org_policies_empty_call_grpc(): @@ -15873,6 +15870,7 @@ def test_analyze_org_policies_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_org_policy_governed_containers_empty_call_grpc(): @@ -15894,6 +15892,7 @@ def test_analyze_org_policy_governed_containers_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_analyze_org_policy_governed_assets_empty_call_grpc(): @@ -15948,6 +15947,7 @@ async def test_export_assets_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -15973,6 +15973,7 @@ async def test_list_assets_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -15997,6 +15998,7 @@ async def test_batch_get_assets_history_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16026,6 +16028,7 @@ async def test_create_feed_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16055,6 +16058,7 @@ async def test_get_feed_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16079,6 +16083,7 @@ async def test_list_feeds_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16108,6 +16113,7 @@ async def test_update_feed_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16131,6 +16137,7 @@ async def test_delete_feed_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16156,6 +16163,7 @@ async def test_search_all_resources_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16181,6 +16189,7 @@ async def test_search_all_iam_policies_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16206,6 +16215,7 @@ async def test_analyze_iam_policy_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16231,6 +16241,7 @@ async def test_analyze_iam_policy_longrunning_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16255,6 +16266,7 @@ async def test_analyze_move_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16281,6 +16293,7 @@ async def test_query_assets_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16309,6 +16322,7 @@ async def test_create_saved_query_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16337,6 +16351,7 @@ async def test_get_saved_query_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16362,6 +16377,7 @@ async def test_list_saved_queries_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16390,6 +16406,7 @@ async def test_update_saved_query_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16413,6 +16430,7 @@ async def test_delete_saved_query_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16437,6 +16455,7 @@ async def test_batch_get_effective_iam_policies_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16462,6 +16481,7 @@ async def test_analyze_org_policies_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -16487,6 +16507,7 @@ async def test_analyze_org_policy_governed_containers_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index d0e1c9b779..044daee67b 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -937,7 +937,6 @@ async def test_generate_access_token_async(transport: str = 'grpc_asyncio', requ async def test_generate_access_token_async_from_dict(): await test_generate_access_token_async(request_type=dict) - def test_generate_access_token_field_headers(): client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1275,7 +1274,6 @@ async def test_generate_id_token_async(transport: str = 'grpc_asyncio', request_ async def test_generate_id_token_async_from_dict(): await test_generate_id_token_async(request_type=dict) - def test_generate_id_token_field_headers(): client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1619,7 +1617,6 @@ async def test_sign_blob_async(transport: str = 'grpc_asyncio', request_type=com async def test_sign_blob_async_from_dict(): await test_sign_blob_async(request_type=dict) - def test_sign_blob_field_headers(): client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1955,7 +1952,6 @@ async def test_sign_jwt_async(transport: str = 'grpc_asyncio', request_type=comm async def test_sign_jwt_async_from_dict(): await test_sign_jwt_async(request_type=dict) - def test_sign_jwt_field_headers(): client = IAMCredentialsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3348,6 +3344,7 @@ def test_generate_access_token_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_generate_id_token_empty_call_grpc(): @@ -3369,6 +3366,7 @@ def test_generate_id_token_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_sign_blob_empty_call_grpc(): @@ -3390,6 +3388,7 @@ def test_sign_blob_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_sign_jwt_empty_call_grpc(): @@ -3444,6 +3443,7 @@ async def test_generate_access_token_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -3469,6 +3469,7 @@ async def test_generate_id_token_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -3495,6 +3496,7 @@ async def test_sign_blob_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index b3b51c9516..35bef8e653 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -973,7 +973,6 @@ async def test_get_trigger_async(transport: str = 'grpc_asyncio', request_type=e async def test_get_trigger_async_from_dict(): await test_get_trigger_async(request_type=dict) - def test_get_trigger_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1293,7 +1292,6 @@ async def test_list_triggers_async(transport: str = 'grpc_asyncio', request_type async def test_list_triggers_async_from_dict(): await test_list_triggers_async(request_type=dict) - def test_list_triggers_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1807,7 +1805,6 @@ async def test_create_trigger_async(transport: str = 'grpc_asyncio', request_typ async def test_create_trigger_async_from_dict(): await test_create_trigger_async(request_type=dict) - def test_create_trigger_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2143,7 +2140,6 @@ async def test_update_trigger_async(transport: str = 'grpc_asyncio', request_typ async def test_update_trigger_async_from_dict(): await test_update_trigger_async(request_type=dict) - def test_update_trigger_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2483,7 +2479,6 @@ async def test_delete_trigger_async(transport: str = 'grpc_asyncio', request_typ async def test_delete_trigger_async_from_dict(): await test_delete_trigger_async(request_type=dict) - def test_delete_trigger_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2826,7 +2821,6 @@ async def test_get_channel_async(transport: str = 'grpc_asyncio', request_type=e async def test_get_channel_async_from_dict(): await test_get_channel_async(request_type=dict) - def test_get_channel_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3144,7 +3138,6 @@ async def test_list_channels_async(transport: str = 'grpc_asyncio', request_type async def test_list_channels_async_from_dict(): await test_list_channels_async(request_type=dict) - def test_list_channels_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3658,7 +3651,6 @@ async def test_create_channel_async(transport: str = 'grpc_asyncio', request_typ async def test_create_channel_async_from_dict(): await test_create_channel_async(request_type=dict) - def test_create_channel_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3994,7 +3986,6 @@ async def test_update_channel_async(transport: str = 'grpc_asyncio', request_typ async def test_update_channel_async_from_dict(): await test_update_channel_async(request_type=dict) - def test_update_channel_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4322,7 +4313,6 @@ async def test_delete_channel_async(transport: str = 'grpc_asyncio', request_typ async def test_delete_channel_async_from_dict(): await test_delete_channel_async(request_type=dict) - def test_delete_channel_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4638,7 +4628,6 @@ async def test_get_provider_async(transport: str = 'grpc_asyncio', request_type= async def test_get_provider_async_from_dict(): await test_get_provider_async(request_type=dict) - def test_get_provider_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4958,7 +4947,6 @@ async def test_list_providers_async(transport: str = 'grpc_asyncio', request_typ async def test_list_providers_async_from_dict(): await test_list_providers_async(request_type=dict) - def test_list_providers_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5476,7 +5464,6 @@ async def test_get_channel_connection_async(transport: str = 'grpc_asyncio', req async def test_get_channel_connection_async_from_dict(): await test_get_channel_connection_async(request_type=dict) - def test_get_channel_connection_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -5792,7 +5779,6 @@ async def test_list_channel_connections_async(transport: str = 'grpc_asyncio', r async def test_list_channel_connections_async_from_dict(): await test_list_channel_connections_async(request_type=dict) - def test_list_channel_connections_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6306,7 +6292,6 @@ async def test_create_channel_connection_async(transport: str = 'grpc_asyncio', async def test_create_channel_connection_async_from_dict(): await test_create_channel_connection_async(request_type=dict) - def test_create_channel_connection_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6644,7 +6629,6 @@ async def test_delete_channel_connection_async(transport: str = 'grpc_asyncio', async def test_delete_channel_connection_async_from_dict(): await test_delete_channel_connection_async(request_type=dict) - def test_delete_channel_connection_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -6960,7 +6944,6 @@ async def test_get_google_channel_config_async(transport: str = 'grpc_asyncio', async def test_get_google_channel_config_async_from_dict(): await test_get_google_channel_config_async(request_type=dict) - def test_get_google_channel_config_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -7272,7 +7255,6 @@ async def test_update_google_channel_config_async(transport: str = 'grpc_asyncio async def test_update_google_channel_config_async_from_dict(): await test_update_google_channel_config_async(request_type=dict) - def test_update_google_channel_config_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -13090,6 +13072,7 @@ def test_get_trigger_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_triggers_empty_call_grpc(): @@ -13111,6 +13094,7 @@ def test_list_triggers_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_trigger_empty_call_grpc(): @@ -13132,6 +13116,7 @@ def test_create_trigger_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_trigger_empty_call_grpc(): @@ -13153,6 +13138,7 @@ def test_update_trigger_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_trigger_empty_call_grpc(): @@ -13174,6 +13160,7 @@ def test_delete_trigger_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_channel_empty_call_grpc(): @@ -13195,6 +13182,7 @@ def test_get_channel_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_channels_empty_call_grpc(): @@ -13216,6 +13204,7 @@ def test_list_channels_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_channel_empty_call_grpc(): @@ -13237,6 +13226,7 @@ def test_create_channel_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_channel_empty_call_grpc(): @@ -13258,6 +13248,7 @@ def test_update_channel_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_channel_empty_call_grpc(): @@ -13279,6 +13270,7 @@ def test_delete_channel_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_provider_empty_call_grpc(): @@ -13300,6 +13292,7 @@ def test_get_provider_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_providers_empty_call_grpc(): @@ -13321,6 +13314,7 @@ def test_list_providers_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_channel_connection_empty_call_grpc(): @@ -13342,6 +13336,7 @@ def test_get_channel_connection_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_channel_connections_empty_call_grpc(): @@ -13363,6 +13358,7 @@ def test_list_channel_connections_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_channel_connection_empty_call_grpc(): @@ -13384,6 +13380,7 @@ def test_create_channel_connection_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_channel_connection_empty_call_grpc(): @@ -13405,6 +13402,7 @@ def test_delete_channel_connection_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_google_channel_config_empty_call_grpc(): @@ -13426,6 +13424,7 @@ def test_get_google_channel_config_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_google_channel_config_empty_call_grpc(): @@ -13484,6 +13483,7 @@ async def test_get_trigger_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13510,6 +13510,7 @@ async def test_list_triggers_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13535,6 +13536,7 @@ async def test_create_trigger_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13560,6 +13562,7 @@ async def test_update_trigger_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13585,6 +13588,7 @@ async def test_delete_trigger_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13615,6 +13619,7 @@ async def test_get_channel_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13641,6 +13646,7 @@ async def test_list_channels_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13666,6 +13672,7 @@ async def test_create_channel_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13691,6 +13698,7 @@ async def test_update_channel_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13716,6 +13724,7 @@ async def test_delete_channel_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13742,6 +13751,7 @@ async def test_get_provider_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13768,6 +13778,7 @@ async def test_list_providers_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13796,6 +13807,7 @@ async def test_get_channel_connection_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13822,6 +13834,7 @@ async def test_list_channel_connections_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13847,6 +13860,7 @@ async def test_create_channel_connection_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13872,6 +13886,7 @@ async def test_delete_channel_connection_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -13898,6 +13913,7 @@ async def test_get_google_channel_config_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index 4fa16b166d..c0244f6a65 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -926,7 +926,6 @@ async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type= async def test_list_buckets_async_from_dict(): await test_list_buckets_async(request_type=dict) - def test_list_buckets_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1456,7 +1455,6 @@ async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=lo async def test_get_bucket_async_from_dict(): await test_get_bucket_async(request_type=dict) - def test_get_bucket_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1692,7 +1690,6 @@ async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', reques async def test_create_bucket_async_async_from_dict(): await test_create_bucket_async_async(request_type=dict) - def test_create_bucket_async_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1926,7 +1923,6 @@ async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', reques async def test_update_bucket_async_async_from_dict(): await test_update_bucket_async_async(request_type=dict) - def test_update_bucket_async_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2180,7 +2176,6 @@ async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type async def test_create_bucket_async_from_dict(): await test_create_bucket_async(request_type=dict) - def test_create_bucket_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2432,7 +2427,6 @@ async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type async def test_update_bucket_async_from_dict(): await test_update_bucket_async(request_type=dict) - def test_update_bucket_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2654,7 +2648,6 @@ async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type async def test_delete_bucket_async_from_dict(): await test_delete_bucket_async(request_type=dict) - def test_delete_bucket_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2876,7 +2869,6 @@ async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_ty async def test_undelete_bucket_async_from_dict(): await test_undelete_bucket_async(request_type=dict) - def test_undelete_bucket_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3106,7 +3098,6 @@ async def test_list_views_async(transport: str = 'grpc_asyncio', request_type=lo async def test_list_views_async_from_dict(): await test_list_views_async(request_type=dict) - def test_list_views_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3620,7 +3611,6 @@ async def test_get_view_async(transport: str = 'grpc_asyncio', request_type=logg async def test_get_view_async_from_dict(): await test_get_view_async(request_type=dict) - def test_get_view_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3858,7 +3848,6 @@ async def test_create_view_async(transport: str = 'grpc_asyncio', request_type=l async def test_create_view_async_from_dict(): await test_create_view_async(request_type=dict) - def test_create_view_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4094,7 +4083,6 @@ async def test_update_view_async(transport: str = 'grpc_asyncio', request_type=l async def test_update_view_async_from_dict(): await test_update_view_async(request_type=dict) - def test_update_view_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4316,7 +4304,6 @@ async def test_delete_view_async(transport: str = 'grpc_asyncio', request_type=l async def test_delete_view_async_from_dict(): await test_delete_view_async(request_type=dict) - def test_delete_view_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4546,7 +4533,6 @@ async def test_list_sinks_async(transport: str = 'grpc_asyncio', request_type=lo async def test_list_sinks_async_from_dict(): await test_list_sinks_async(request_type=dict) - def test_list_sinks_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5080,7 +5066,6 @@ async def test_get_sink_async(transport: str = 'grpc_asyncio', request_type=logg async def test_get_sink_async_from_dict(): await test_get_sink_async(request_type=dict) - def test_get_sink_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5418,7 +5403,6 @@ async def test_create_sink_async(transport: str = 'grpc_asyncio', request_type=l async def test_create_sink_async_from_dict(): await test_create_sink_async(request_type=dict) - def test_create_sink_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5766,7 +5750,6 @@ async def test_update_sink_async(transport: str = 'grpc_asyncio', request_type=l async def test_update_sink_async_from_dict(): await test_update_sink_async(request_type=dict) - def test_update_sink_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6090,7 +6073,6 @@ async def test_delete_sink_async(transport: str = 'grpc_asyncio', request_type=l async def test_delete_sink_async_from_dict(): await test_delete_sink_async(request_type=dict) - def test_delete_sink_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6408,7 +6390,6 @@ async def test_create_link_async(transport: str = 'grpc_asyncio', request_type=l async def test_create_link_async_from_dict(): await test_create_link_async(request_type=dict) - def test_create_link_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6746,7 +6727,6 @@ async def test_delete_link_async(transport: str = 'grpc_asyncio', request_type=l async def test_delete_link_async_from_dict(): await test_delete_link_async(request_type=dict) - def test_delete_link_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7060,7 +7040,6 @@ async def test_list_links_async(transport: str = 'grpc_asyncio', request_type=lo async def test_list_links_async_from_dict(): await test_list_links_async(request_type=dict) - def test_list_links_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7574,7 +7553,6 @@ async def test_get_link_async(transport: str = 'grpc_asyncio', request_type=logg async def test_get_link_async_from_dict(): await test_get_link_async(request_type=dict) - def test_get_link_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7886,7 +7864,6 @@ async def test_list_exclusions_async(transport: str = 'grpc_asyncio', request_ty async def test_list_exclusions_async_from_dict(): await test_list_exclusions_async(request_type=dict) - def test_list_exclusions_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -8404,7 +8381,6 @@ async def test_get_exclusion_async(transport: str = 'grpc_asyncio', request_type async def test_get_exclusion_async_from_dict(): await test_get_exclusion_async(request_type=dict) - def test_get_exclusion_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -8726,7 +8702,6 @@ async def test_create_exclusion_async(transport: str = 'grpc_asyncio', request_t async def test_create_exclusion_async_from_dict(): await test_create_exclusion_async(request_type=dict) - def test_create_exclusion_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9058,7 +9033,6 @@ async def test_update_exclusion_async(transport: str = 'grpc_asyncio', request_t async def test_update_exclusion_async_from_dict(): await test_update_exclusion_async(request_type=dict) - def test_update_exclusion_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9382,7 +9356,6 @@ async def test_delete_exclusion_async(transport: str = 'grpc_asyncio', request_t async def test_delete_exclusion_async_from_dict(): await test_delete_exclusion_async(request_type=dict) - def test_delete_exclusion_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9704,7 +9677,6 @@ async def test_get_cmek_settings_async(transport: str = 'grpc_asyncio', request_ async def test_get_cmek_settings_async_from_dict(): await test_get_cmek_settings_async(request_type=dict) - def test_get_cmek_settings_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9944,7 +9916,6 @@ async def test_update_cmek_settings_async(transport: str = 'grpc_asyncio', reque async def test_update_cmek_settings_async_from_dict(): await test_update_cmek_settings_async(request_type=dict) - def test_update_cmek_settings_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10188,7 +10159,6 @@ async def test_get_settings_async(transport: str = 'grpc_asyncio', request_type= async def test_get_settings_async_from_dict(): await test_get_settings_async(request_type=dict) - def test_get_settings_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10514,7 +10484,6 @@ async def test_update_settings_async(transport: str = 'grpc_asyncio', request_ty async def test_update_settings_async_from_dict(): await test_update_settings_async(request_type=dict) - def test_update_settings_field_headers(): client = ConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10959,6 +10928,7 @@ def test_list_buckets_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_bucket_empty_call_grpc(): @@ -10980,6 +10950,7 @@ def test_get_bucket_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_bucket_async_empty_call_grpc(): @@ -11001,6 +10972,7 @@ def test_create_bucket_async_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_bucket_async_empty_call_grpc(): @@ -11022,6 +10994,7 @@ def test_update_bucket_async_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_bucket_empty_call_grpc(): @@ -11043,6 +11016,7 @@ def test_create_bucket_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_bucket_empty_call_grpc(): @@ -11064,6 +11038,7 @@ def test_update_bucket_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_bucket_empty_call_grpc(): @@ -11085,6 +11060,7 @@ def test_delete_bucket_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_undelete_bucket_empty_call_grpc(): @@ -11106,6 +11082,7 @@ def test_undelete_bucket_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_views_empty_call_grpc(): @@ -11127,6 +11104,7 @@ def test_list_views_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_view_empty_call_grpc(): @@ -11148,6 +11126,7 @@ def test_get_view_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_view_empty_call_grpc(): @@ -11169,6 +11148,7 @@ def test_create_view_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_view_empty_call_grpc(): @@ -11190,6 +11170,7 @@ def test_update_view_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_view_empty_call_grpc(): @@ -11211,6 +11192,7 @@ def test_delete_view_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_sinks_empty_call_grpc(): @@ -11232,6 +11214,7 @@ def test_list_sinks_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_sink_empty_call_grpc(): @@ -11253,6 +11236,7 @@ def test_get_sink_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_sink_empty_call_grpc(): @@ -11274,6 +11258,7 @@ def test_create_sink_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_sink_empty_call_grpc(): @@ -11295,6 +11280,7 @@ def test_update_sink_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_sink_empty_call_grpc(): @@ -11316,6 +11302,7 @@ def test_delete_sink_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_link_empty_call_grpc(): @@ -11337,6 +11324,7 @@ def test_create_link_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_link_empty_call_grpc(): @@ -11358,6 +11346,7 @@ def test_delete_link_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_links_empty_call_grpc(): @@ -11379,6 +11368,7 @@ def test_list_links_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_link_empty_call_grpc(): @@ -11400,6 +11390,7 @@ def test_get_link_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_exclusions_empty_call_grpc(): @@ -11421,6 +11412,7 @@ def test_list_exclusions_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_exclusion_empty_call_grpc(): @@ -11442,6 +11434,7 @@ def test_get_exclusion_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_exclusion_empty_call_grpc(): @@ -11463,6 +11456,7 @@ def test_create_exclusion_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_exclusion_empty_call_grpc(): @@ -11484,6 +11478,7 @@ def test_update_exclusion_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_exclusion_empty_call_grpc(): @@ -11505,6 +11500,7 @@ def test_delete_exclusion_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_cmek_settings_empty_call_grpc(): @@ -11526,6 +11522,7 @@ def test_get_cmek_settings_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_cmek_settings_empty_call_grpc(): @@ -11547,6 +11544,7 @@ def test_update_cmek_settings_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_settings_empty_call_grpc(): @@ -11568,6 +11566,7 @@ def test_get_settings_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_settings_empty_call_grpc(): @@ -11589,6 +11588,7 @@ def test_update_settings_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_copy_log_entries_empty_call_grpc(): @@ -11643,6 +11643,7 @@ async def test_list_buckets_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11674,6 +11675,7 @@ async def test_get_bucket_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11699,6 +11701,7 @@ async def test_create_bucket_async_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11724,6 +11727,7 @@ async def test_update_bucket_async_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11755,6 +11759,7 @@ async def test_create_bucket_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11786,6 +11791,7 @@ async def test_update_bucket_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11809,6 +11815,7 @@ async def test_delete_bucket_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11832,6 +11839,7 @@ async def test_undelete_bucket_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11857,6 +11865,7 @@ async def test_list_views_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11884,6 +11893,7 @@ async def test_get_view_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11911,6 +11921,7 @@ async def test_create_view_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11938,6 +11949,7 @@ async def test_update_view_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11961,6 +11973,7 @@ async def test_delete_view_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -11986,6 +11999,7 @@ async def test_list_sinks_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12018,6 +12032,7 @@ async def test_get_sink_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12050,6 +12065,7 @@ async def test_create_sink_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12082,6 +12098,7 @@ async def test_update_sink_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12105,6 +12122,7 @@ async def test_delete_sink_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12130,6 +12148,7 @@ async def test_create_link_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12155,6 +12174,7 @@ async def test_delete_link_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12180,6 +12200,7 @@ async def test_list_links_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12207,6 +12228,7 @@ async def test_get_link_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12232,6 +12254,7 @@ async def test_list_exclusions_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12260,6 +12283,7 @@ async def test_get_exclusion_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12288,6 +12312,7 @@ async def test_create_exclusion_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12316,6 +12341,7 @@ async def test_update_exclusion_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12339,6 +12365,7 @@ async def test_delete_exclusion_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12367,6 +12394,7 @@ async def test_get_cmek_settings_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12395,6 +12423,7 @@ async def test_update_cmek_settings_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12424,6 +12453,7 @@ async def test_get_settings_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -12453,6 +12483,7 @@ async def test_update_settings_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 3e194557b0..954d48fd1a 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -920,7 +920,6 @@ async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=lo async def test_delete_log_async_from_dict(): await test_delete_log_async(request_type=dict) - def test_delete_log_field_headers(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2327,7 +2326,6 @@ async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=log async def test_list_logs_async_from_dict(): await test_list_logs_async(request_type=dict) - def test_list_logs_field_headers(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2918,6 +2916,7 @@ def test_delete_log_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_write_log_entries_empty_call_grpc(): @@ -2939,6 +2938,7 @@ def test_write_log_entries_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_log_entries_empty_call_grpc(): @@ -2960,6 +2960,7 @@ def test_list_log_entries_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_monitored_resource_descriptors_empty_call_grpc(): @@ -2981,6 +2982,7 @@ def test_list_monitored_resource_descriptors_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_logs_empty_call_grpc(): @@ -3033,6 +3035,7 @@ async def test_delete_log_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -3057,6 +3060,7 @@ async def test_write_log_entries_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -3082,6 +3086,7 @@ async def test_list_log_entries_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -3107,6 +3112,7 @@ async def test_list_monitored_resource_descriptors_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index a01c1fd5e7..f89049be56 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -926,7 +926,6 @@ async def test_list_log_metrics_async(transport: str = 'grpc_asyncio', request_t async def test_list_log_metrics_async_from_dict(): await test_list_log_metrics_async(request_type=dict) - def test_list_log_metrics_field_headers(): client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1456,7 +1455,6 @@ async def test_get_log_metric_async(transport: str = 'grpc_asyncio', request_typ async def test_get_log_metric_async_from_dict(): await test_get_log_metric_async(request_type=dict) - def test_get_log_metric_field_headers(): client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1790,7 +1788,6 @@ async def test_create_log_metric_async(transport: str = 'grpc_asyncio', request_ async def test_create_log_metric_async_from_dict(): await test_create_log_metric_async(request_type=dict) - def test_create_log_metric_field_headers(): client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2134,7 +2131,6 @@ async def test_update_log_metric_async(transport: str = 'grpc_asyncio', request_ async def test_update_log_metric_async_from_dict(): await test_update_log_metric_async(request_type=dict) - def test_update_log_metric_field_headers(): client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2448,7 +2444,6 @@ async def test_delete_log_metric_async(transport: str = 'grpc_asyncio', request_ async def test_delete_log_metric_async_from_dict(): await test_delete_log_metric_async(request_type=dict) - def test_delete_log_metric_field_headers(): client = MetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2708,6 +2703,7 @@ def test_list_log_metrics_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_log_metric_empty_call_grpc(): @@ -2729,6 +2725,7 @@ def test_get_log_metric_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_log_metric_empty_call_grpc(): @@ -2750,6 +2747,7 @@ def test_create_log_metric_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_log_metric_empty_call_grpc(): @@ -2771,6 +2769,7 @@ def test_update_log_metric_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_log_metric_empty_call_grpc(): @@ -2825,6 +2824,7 @@ async def test_list_log_metrics_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -2856,6 +2856,7 @@ async def test_get_log_metric_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -2887,6 +2888,7 @@ async def test_create_log_metric_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -2918,6 +2920,7 @@ async def test_update_log_metric_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index df42569a57..73666289c2 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -954,7 +954,6 @@ async def test_list_instances_async(transport: str = 'grpc_asyncio', request_typ async def test_list_instances_async_from_dict(): await test_list_instances_async(request_type=dict) - def test_list_instances_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1564,7 +1563,6 @@ async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type= async def test_get_instance_async_from_dict(): await test_get_instance_async(request_type=dict) - def test_get_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1874,7 +1872,6 @@ async def test_get_instance_auth_string_async(transport: str = 'grpc_asyncio', r async def test_get_instance_auth_string_async_from_dict(): await test_get_instance_auth_string_async(request_type=dict) - def test_get_instance_auth_string_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2192,7 +2189,6 @@ async def test_create_instance_async(transport: str = 'grpc_asyncio', request_ty async def test_create_instance_async_from_dict(): await test_create_instance_async(request_type=dict) - def test_create_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2528,7 +2524,6 @@ async def test_update_instance_async(transport: str = 'grpc_asyncio', request_ty async def test_update_instance_async_from_dict(): await test_update_instance_async(request_type=dict) - def test_update_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2858,7 +2853,6 @@ async def test_upgrade_instance_async(transport: str = 'grpc_asyncio', request_t async def test_upgrade_instance_async_from_dict(): await test_upgrade_instance_async(request_type=dict) - def test_upgrade_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3186,7 +3180,6 @@ async def test_import_instance_async(transport: str = 'grpc_asyncio', request_ty async def test_import_instance_async_from_dict(): await test_import_instance_async(request_type=dict) - def test_import_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3514,7 +3507,6 @@ async def test_export_instance_async(transport: str = 'grpc_asyncio', request_ty async def test_export_instance_async_from_dict(): await test_export_instance_async(request_type=dict) - def test_export_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3842,7 +3834,6 @@ async def test_failover_instance_async(transport: str = 'grpc_asyncio', request_ async def test_failover_instance_async_from_dict(): await test_failover_instance_async(request_type=dict) - def test_failover_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4170,7 +4161,6 @@ async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_ty async def test_delete_instance_async_from_dict(): await test_delete_instance_async(request_type=dict) - def test_delete_instance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4488,7 +4478,6 @@ async def test_reschedule_maintenance_async(transport: str = 'grpc_asyncio', req async def test_reschedule_maintenance_async_from_dict(): await test_reschedule_maintenance_async(request_type=dict) - def test_reschedule_maintenance_field_headers(): client = CloudRedisClient( credentials=ga_credentials.AnonymousCredentials(), @@ -7942,6 +7931,7 @@ def test_list_instances_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_instance_empty_call_grpc(): @@ -7963,6 +7953,7 @@ def test_get_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_instance_auth_string_empty_call_grpc(): @@ -7984,6 +7975,7 @@ def test_get_instance_auth_string_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_instance_empty_call_grpc(): @@ -8005,6 +7997,7 @@ def test_create_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_instance_empty_call_grpc(): @@ -8026,6 +8019,7 @@ def test_update_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_upgrade_instance_empty_call_grpc(): @@ -8047,6 +8041,7 @@ def test_upgrade_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_import_instance_empty_call_grpc(): @@ -8068,6 +8063,7 @@ def test_import_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_export_instance_empty_call_grpc(): @@ -8089,6 +8085,7 @@ def test_export_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_failover_instance_empty_call_grpc(): @@ -8110,6 +8107,7 @@ def test_failover_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_instance_empty_call_grpc(): @@ -8131,6 +8129,7 @@ def test_delete_instance_empty_call_grpc(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_reschedule_maintenance_empty_call_grpc(): @@ -8186,6 +8185,7 @@ async def test_list_instances_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8237,6 +8237,7 @@ async def test_get_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8262,6 +8263,7 @@ async def test_get_instance_auth_string_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8287,6 +8289,7 @@ async def test_create_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8312,6 +8315,7 @@ async def test_update_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8337,6 +8341,7 @@ async def test_upgrade_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8362,6 +8367,7 @@ async def test_import_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8387,6 +8393,7 @@ async def test_export_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8412,6 +8419,7 @@ async def test_failover_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio @@ -8437,6 +8445,7 @@ async def test_delete_instance_empty_call_grpc_asyncio(): assert args[0] == request_msg + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio From c955243e863c55afaa662fe200fa1b896a77a356 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 15 Sep 2024 15:05:41 +0000 Subject: [PATCH 20/23] See https://github.com/googleapis/gapic-generator-python/issues/2159 --- .../tests/unit/gapic/%name_%version/%sub/test_macros.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 55fd01f1da..39234a169a 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1889,6 +1889,11 @@ def test_transport_kind_{{ transport_name }}(): {%- endmacro %}{# uuid_re #} {% macro routing_parameter_test(service, api, transport, is_async) %} +{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2159): + Currently this macro only supports gRPC. It should be updated to support REST + transport as well. +#} +{% if 'rest' not in transport %} {% for method in service.methods.values() %}{# method #} {% if method.explicit_routing %} {# Any value that is part of the HTTP/1.1 URI should be sent as #} @@ -1898,4 +1903,5 @@ def test_transport_kind_{{ transport_name }}(): {% endfor %}{# routing_param in method.routing_rule.routing_parameters #} {% endif %}{# method.explicit_routing #} {% endfor %}{# method in service.methods.values() #} +{% endif %} {% endmacro %}{# routing_parameter_test #} From 3da4cc9436b84863dfa917ba3061aff05185ceb6 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 16 Sep 2024 21:59:18 +0000 Subject: [PATCH 21/23] address review feedback --- .../%name_%version/%sub/services/%service/_shared_macros.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 index e84183de18..8fec390957 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 @@ -86,11 +86,11 @@ except ImportError: # pragma: NO COVER # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata(( - {% for field_header in method.field_headers %} {% if not method.client_streaming %} + {% for field_header in method.field_headers %} ("{{ field_header.raw }}", request.{{ field_header.disambiguated }}), - {% endif %} - {% endfor %} + {% endfor %}{# for field_header in method.field_headers #} + {% endif %}{# not method.client_streaming #} )), ) {% endif %}{# method.explicit_routing #} From 5f945a6cf37728804d723b3a1a601ec941354302 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 18 Sep 2024 10:40:11 -0400 Subject: [PATCH 22/23] typo Co-authored-by: Victor Chudnovsky --- .../tests/unit/gapic/%name_%version/%sub/test_macros.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 39234a169a..dc42bdc174 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1899,7 +1899,7 @@ def test_transport_kind_{{ transport_name }}(): {# Any value that is part of the HTTP/1.1 URI should be sent as #} {# a field header. Set these to a non-empty value. #} {% for routing_param in method.routing_rule.routing_parameters %} -{{ method_call_test_generic("routing_parameters_request_" + loop.index|string, method, service, api, transport, request_dict=routing_param.sample_request,is_async=is_async, routing_param=routing_param) }} +{{ method_call_test_generic("routing_parameters_request_" + loop.index|string, method, service, api, transport, request_dict=routing_param.sample_request, is_async=is_async, routing_param=routing_param) }} {% endfor %}{# routing_param in method.routing_rule.routing_parameters #} {% endif %}{# method.explicit_routing #} {% endfor %}{# method in service.methods.values() #} From 5fa4a39059115ca0aaef17bbccd956045c938973 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 18 Sep 2024 14:45:22 +0000 Subject: [PATCH 23/23] address review feedback --- .../gapic/%name_%version/%sub/test_macros.j2 | 2 +- .../unit/gapic/asset_v1/test_asset_service.py | 92 ++++++------- .../credentials_v1/test_iam_credentials.py | 16 +-- .../unit/gapic/eventarc_v1/test_eventarc.py | 72 +++++----- .../logging_v2/test_config_service_v2.py | 128 +++++++++--------- .../logging_v2/test_logging_service_v2.py | 20 +-- .../logging_v2/test_metrics_service_v2.py | 20 +-- .../unit/gapic/redis_v1/test_cloud_redis.py | 44 +++--- 8 files changed, 197 insertions(+), 197 deletions(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index dc42bdc174..f3c20ea5db 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1822,7 +1822,7 @@ def test_{{ method_name }}_rest_no_http_options(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, {% if routing_param %}kw{% else %}_{% endif %} = call.mock_calls[0] {% with method_settings = api.all_method_settings.get(method.meta.address.proto) %} {% if method_settings is not none %} {% for auto_populated_field in method_settings.auto_populated_fields %} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index a0849c32cf..200bcec7e3 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -15425,7 +15425,7 @@ def test_export_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ExportAssetsRequest() assert args[0] == request_msg @@ -15447,7 +15447,7 @@ def test_list_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListAssetsRequest() assert args[0] == request_msg @@ -15469,7 +15469,7 @@ def test_batch_get_assets_history_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.BatchGetAssetsHistoryRequest() assert args[0] == request_msg @@ -15491,7 +15491,7 @@ def test_create_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.CreateFeedRequest() assert args[0] == request_msg @@ -15513,7 +15513,7 @@ def test_get_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.GetFeedRequest() assert args[0] == request_msg @@ -15535,7 +15535,7 @@ def test_list_feeds_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListFeedsRequest() assert args[0] == request_msg @@ -15557,7 +15557,7 @@ def test_update_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.UpdateFeedRequest() assert args[0] == request_msg @@ -15579,7 +15579,7 @@ def test_delete_feed_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.DeleteFeedRequest() assert args[0] == request_msg @@ -15601,7 +15601,7 @@ def test_search_all_resources_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.SearchAllResourcesRequest() assert args[0] == request_msg @@ -15623,7 +15623,7 @@ def test_search_all_iam_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.SearchAllIamPoliciesRequest() assert args[0] == request_msg @@ -15645,7 +15645,7 @@ def test_analyze_iam_policy_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeIamPolicyRequest() assert args[0] == request_msg @@ -15667,7 +15667,7 @@ def test_analyze_iam_policy_longrunning_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() assert args[0] == request_msg @@ -15689,7 +15689,7 @@ def test_analyze_move_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeMoveRequest() assert args[0] == request_msg @@ -15711,7 +15711,7 @@ def test_query_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.QueryAssetsRequest() assert args[0] == request_msg @@ -15733,7 +15733,7 @@ def test_create_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.CreateSavedQueryRequest() assert args[0] == request_msg @@ -15755,7 +15755,7 @@ def test_get_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.GetSavedQueryRequest() assert args[0] == request_msg @@ -15777,7 +15777,7 @@ def test_list_saved_queries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListSavedQueriesRequest() assert args[0] == request_msg @@ -15799,7 +15799,7 @@ def test_update_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.UpdateSavedQueryRequest() assert args[0] == request_msg @@ -15821,7 +15821,7 @@ def test_delete_saved_query_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.DeleteSavedQueryRequest() assert args[0] == request_msg @@ -15843,7 +15843,7 @@ def test_batch_get_effective_iam_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() assert args[0] == request_msg @@ -15865,7 +15865,7 @@ def test_analyze_org_policies_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPoliciesRequest() assert args[0] == request_msg @@ -15887,7 +15887,7 @@ def test_analyze_org_policy_governed_containers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() assert args[0] == request_msg @@ -15909,7 +15909,7 @@ def test_analyze_org_policy_governed_assets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() assert args[0] == request_msg @@ -15942,7 +15942,7 @@ async def test_export_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ExportAssetsRequest() assert args[0] == request_msg @@ -15968,7 +15968,7 @@ async def test_list_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListAssetsRequest() assert args[0] == request_msg @@ -15993,7 +15993,7 @@ async def test_batch_get_assets_history_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.BatchGetAssetsHistoryRequest() assert args[0] == request_msg @@ -16023,7 +16023,7 @@ async def test_create_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.CreateFeedRequest() assert args[0] == request_msg @@ -16053,7 +16053,7 @@ async def test_get_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.GetFeedRequest() assert args[0] == request_msg @@ -16078,7 +16078,7 @@ async def test_list_feeds_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListFeedsRequest() assert args[0] == request_msg @@ -16108,7 +16108,7 @@ async def test_update_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.UpdateFeedRequest() assert args[0] == request_msg @@ -16132,7 +16132,7 @@ async def test_delete_feed_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.DeleteFeedRequest() assert args[0] == request_msg @@ -16158,7 +16158,7 @@ async def test_search_all_resources_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.SearchAllResourcesRequest() assert args[0] == request_msg @@ -16184,7 +16184,7 @@ async def test_search_all_iam_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.SearchAllIamPoliciesRequest() assert args[0] == request_msg @@ -16210,7 +16210,7 @@ async def test_analyze_iam_policy_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeIamPolicyRequest() assert args[0] == request_msg @@ -16236,7 +16236,7 @@ async def test_analyze_iam_policy_longrunning_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeIamPolicyLongrunningRequest() assert args[0] == request_msg @@ -16261,7 +16261,7 @@ async def test_analyze_move_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeMoveRequest() assert args[0] == request_msg @@ -16288,7 +16288,7 @@ async def test_query_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.QueryAssetsRequest() assert args[0] == request_msg @@ -16317,7 +16317,7 @@ async def test_create_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.CreateSavedQueryRequest() assert args[0] == request_msg @@ -16346,7 +16346,7 @@ async def test_get_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.GetSavedQueryRequest() assert args[0] == request_msg @@ -16372,7 +16372,7 @@ async def test_list_saved_queries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.ListSavedQueriesRequest() assert args[0] == request_msg @@ -16401,7 +16401,7 @@ async def test_update_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.UpdateSavedQueryRequest() assert args[0] == request_msg @@ -16425,7 +16425,7 @@ async def test_delete_saved_query_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.DeleteSavedQueryRequest() assert args[0] == request_msg @@ -16450,7 +16450,7 @@ async def test_batch_get_effective_iam_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.BatchGetEffectiveIamPoliciesRequest() assert args[0] == request_msg @@ -16476,7 +16476,7 @@ async def test_analyze_org_policies_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPoliciesRequest() assert args[0] == request_msg @@ -16502,7 +16502,7 @@ async def test_analyze_org_policy_governed_containers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPolicyGovernedContainersRequest() assert args[0] == request_msg @@ -16528,7 +16528,7 @@ async def test_analyze_org_policy_governed_assets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 044daee67b..553259e950 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -3339,7 +3339,7 @@ def test_generate_access_token_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.GenerateAccessTokenRequest() assert args[0] == request_msg @@ -3361,7 +3361,7 @@ def test_generate_id_token_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.GenerateIdTokenRequest() assert args[0] == request_msg @@ -3383,7 +3383,7 @@ def test_sign_blob_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.SignBlobRequest() assert args[0] == request_msg @@ -3405,7 +3405,7 @@ def test_sign_jwt_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.SignJwtRequest() assert args[0] == request_msg @@ -3438,7 +3438,7 @@ async def test_generate_access_token_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.GenerateAccessTokenRequest() assert args[0] == request_msg @@ -3464,7 +3464,7 @@ async def test_generate_id_token_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.GenerateIdTokenRequest() assert args[0] == request_msg @@ -3491,7 +3491,7 @@ async def test_sign_blob_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.SignBlobRequest() assert args[0] == request_msg @@ -3518,7 +3518,7 @@ async def test_sign_jwt_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = common.SignJwtRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index 35bef8e653..3770b34748 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -13067,7 +13067,7 @@ def test_get_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetTriggerRequest() assert args[0] == request_msg @@ -13089,7 +13089,7 @@ def test_list_triggers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListTriggersRequest() assert args[0] == request_msg @@ -13111,7 +13111,7 @@ def test_create_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateTriggerRequest() assert args[0] == request_msg @@ -13133,7 +13133,7 @@ def test_update_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateTriggerRequest() assert args[0] == request_msg @@ -13155,7 +13155,7 @@ def test_delete_trigger_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteTriggerRequest() assert args[0] == request_msg @@ -13177,7 +13177,7 @@ def test_get_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetChannelRequest() assert args[0] == request_msg @@ -13199,7 +13199,7 @@ def test_list_channels_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListChannelsRequest() assert args[0] == request_msg @@ -13221,7 +13221,7 @@ def test_create_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateChannelRequest() assert args[0] == request_msg @@ -13243,7 +13243,7 @@ def test_update_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateChannelRequest() assert args[0] == request_msg @@ -13265,7 +13265,7 @@ def test_delete_channel_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteChannelRequest() assert args[0] == request_msg @@ -13287,7 +13287,7 @@ def test_get_provider_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetProviderRequest() assert args[0] == request_msg @@ -13309,7 +13309,7 @@ def test_list_providers_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListProvidersRequest() assert args[0] == request_msg @@ -13331,7 +13331,7 @@ def test_get_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetChannelConnectionRequest() assert args[0] == request_msg @@ -13353,7 +13353,7 @@ def test_list_channel_connections_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListChannelConnectionsRequest() assert args[0] == request_msg @@ -13375,7 +13375,7 @@ def test_create_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateChannelConnectionRequest() assert args[0] == request_msg @@ -13397,7 +13397,7 @@ def test_delete_channel_connection_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteChannelConnectionRequest() assert args[0] == request_msg @@ -13419,7 +13419,7 @@ def test_get_google_channel_config_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetGoogleChannelConfigRequest() assert args[0] == request_msg @@ -13441,7 +13441,7 @@ def test_update_google_channel_config_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateGoogleChannelConfigRequest() assert args[0] == request_msg @@ -13478,7 +13478,7 @@ async def test_get_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetTriggerRequest() assert args[0] == request_msg @@ -13505,7 +13505,7 @@ async def test_list_triggers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListTriggersRequest() assert args[0] == request_msg @@ -13531,7 +13531,7 @@ async def test_create_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateTriggerRequest() assert args[0] == request_msg @@ -13557,7 +13557,7 @@ async def test_update_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateTriggerRequest() assert args[0] == request_msg @@ -13583,7 +13583,7 @@ async def test_delete_trigger_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteTriggerRequest() assert args[0] == request_msg @@ -13614,7 +13614,7 @@ async def test_get_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetChannelRequest() assert args[0] == request_msg @@ -13641,7 +13641,7 @@ async def test_list_channels_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListChannelsRequest() assert args[0] == request_msg @@ -13667,7 +13667,7 @@ async def test_create_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateChannelRequest() assert args[0] == request_msg @@ -13693,7 +13693,7 @@ async def test_update_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateChannelRequest() assert args[0] == request_msg @@ -13719,7 +13719,7 @@ async def test_delete_channel_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteChannelRequest() assert args[0] == request_msg @@ -13746,7 +13746,7 @@ async def test_get_provider_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetProviderRequest() assert args[0] == request_msg @@ -13773,7 +13773,7 @@ async def test_list_providers_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListProvidersRequest() assert args[0] == request_msg @@ -13802,7 +13802,7 @@ async def test_get_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetChannelConnectionRequest() assert args[0] == request_msg @@ -13829,7 +13829,7 @@ async def test_list_channel_connections_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.ListChannelConnectionsRequest() assert args[0] == request_msg @@ -13855,7 +13855,7 @@ async def test_create_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.CreateChannelConnectionRequest() assert args[0] == request_msg @@ -13881,7 +13881,7 @@ async def test_delete_channel_connection_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.DeleteChannelConnectionRequest() assert args[0] == request_msg @@ -13908,7 +13908,7 @@ async def test_get_google_channel_config_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.GetGoogleChannelConfigRequest() assert args[0] == request_msg @@ -13935,7 +13935,7 @@ async def test_update_google_channel_config_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = eventarc.UpdateGoogleChannelConfigRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index c0244f6a65..bb77f848fb 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -10923,7 +10923,7 @@ def test_list_buckets_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListBucketsRequest() assert args[0] == request_msg @@ -10945,7 +10945,7 @@ def test_get_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetBucketRequest() assert args[0] == request_msg @@ -10967,7 +10967,7 @@ def test_create_bucket_async_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateBucketRequest() assert args[0] == request_msg @@ -10989,7 +10989,7 @@ def test_update_bucket_async_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateBucketRequest() assert args[0] == request_msg @@ -11011,7 +11011,7 @@ def test_create_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateBucketRequest() assert args[0] == request_msg @@ -11033,7 +11033,7 @@ def test_update_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateBucketRequest() assert args[0] == request_msg @@ -11055,7 +11055,7 @@ def test_delete_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteBucketRequest() assert args[0] == request_msg @@ -11077,7 +11077,7 @@ def test_undelete_bucket_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UndeleteBucketRequest() assert args[0] == request_msg @@ -11099,7 +11099,7 @@ def test_list_views_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListViewsRequest() assert args[0] == request_msg @@ -11121,7 +11121,7 @@ def test_get_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetViewRequest() assert args[0] == request_msg @@ -11143,7 +11143,7 @@ def test_create_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateViewRequest() assert args[0] == request_msg @@ -11165,7 +11165,7 @@ def test_update_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateViewRequest() assert args[0] == request_msg @@ -11187,7 +11187,7 @@ def test_delete_view_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteViewRequest() assert args[0] == request_msg @@ -11209,7 +11209,7 @@ def test_list_sinks_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListSinksRequest() assert args[0] == request_msg @@ -11231,7 +11231,7 @@ def test_get_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetSinkRequest() assert args[0] == request_msg @@ -11253,7 +11253,7 @@ def test_create_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateSinkRequest() assert args[0] == request_msg @@ -11275,7 +11275,7 @@ def test_update_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateSinkRequest() assert args[0] == request_msg @@ -11297,7 +11297,7 @@ def test_delete_sink_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteSinkRequest() assert args[0] == request_msg @@ -11319,7 +11319,7 @@ def test_create_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateLinkRequest() assert args[0] == request_msg @@ -11341,7 +11341,7 @@ def test_delete_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteLinkRequest() assert args[0] == request_msg @@ -11363,7 +11363,7 @@ def test_list_links_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListLinksRequest() assert args[0] == request_msg @@ -11385,7 +11385,7 @@ def test_get_link_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetLinkRequest() assert args[0] == request_msg @@ -11407,7 +11407,7 @@ def test_list_exclusions_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListExclusionsRequest() assert args[0] == request_msg @@ -11429,7 +11429,7 @@ def test_get_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetExclusionRequest() assert args[0] == request_msg @@ -11451,7 +11451,7 @@ def test_create_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateExclusionRequest() assert args[0] == request_msg @@ -11473,7 +11473,7 @@ def test_update_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateExclusionRequest() assert args[0] == request_msg @@ -11495,7 +11495,7 @@ def test_delete_exclusion_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteExclusionRequest() assert args[0] == request_msg @@ -11517,7 +11517,7 @@ def test_get_cmek_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetCmekSettingsRequest() assert args[0] == request_msg @@ -11539,7 +11539,7 @@ def test_update_cmek_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateCmekSettingsRequest() assert args[0] == request_msg @@ -11561,7 +11561,7 @@ def test_get_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetSettingsRequest() assert args[0] == request_msg @@ -11583,7 +11583,7 @@ def test_update_settings_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateSettingsRequest() assert args[0] == request_msg @@ -11605,7 +11605,7 @@ def test_copy_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CopyLogEntriesRequest() assert args[0] == request_msg @@ -11638,7 +11638,7 @@ async def test_list_buckets_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListBucketsRequest() assert args[0] == request_msg @@ -11670,7 +11670,7 @@ async def test_get_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetBucketRequest() assert args[0] == request_msg @@ -11696,7 +11696,7 @@ async def test_create_bucket_async_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateBucketRequest() assert args[0] == request_msg @@ -11722,7 +11722,7 @@ async def test_update_bucket_async_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateBucketRequest() assert args[0] == request_msg @@ -11754,7 +11754,7 @@ async def test_create_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateBucketRequest() assert args[0] == request_msg @@ -11786,7 +11786,7 @@ async def test_update_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateBucketRequest() assert args[0] == request_msg @@ -11810,7 +11810,7 @@ async def test_delete_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteBucketRequest() assert args[0] == request_msg @@ -11834,7 +11834,7 @@ async def test_undelete_bucket_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UndeleteBucketRequest() assert args[0] == request_msg @@ -11860,7 +11860,7 @@ async def test_list_views_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListViewsRequest() assert args[0] == request_msg @@ -11888,7 +11888,7 @@ async def test_get_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetViewRequest() assert args[0] == request_msg @@ -11916,7 +11916,7 @@ async def test_create_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateViewRequest() assert args[0] == request_msg @@ -11944,7 +11944,7 @@ async def test_update_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateViewRequest() assert args[0] == request_msg @@ -11968,7 +11968,7 @@ async def test_delete_view_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteViewRequest() assert args[0] == request_msg @@ -11994,7 +11994,7 @@ async def test_list_sinks_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListSinksRequest() assert args[0] == request_msg @@ -12027,7 +12027,7 @@ async def test_get_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetSinkRequest() assert args[0] == request_msg @@ -12060,7 +12060,7 @@ async def test_create_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateSinkRequest() assert args[0] == request_msg @@ -12093,7 +12093,7 @@ async def test_update_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateSinkRequest() assert args[0] == request_msg @@ -12117,7 +12117,7 @@ async def test_delete_sink_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteSinkRequest() assert args[0] == request_msg @@ -12143,7 +12143,7 @@ async def test_create_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateLinkRequest() assert args[0] == request_msg @@ -12169,7 +12169,7 @@ async def test_delete_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteLinkRequest() assert args[0] == request_msg @@ -12195,7 +12195,7 @@ async def test_list_links_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListLinksRequest() assert args[0] == request_msg @@ -12223,7 +12223,7 @@ async def test_get_link_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetLinkRequest() assert args[0] == request_msg @@ -12249,7 +12249,7 @@ async def test_list_exclusions_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.ListExclusionsRequest() assert args[0] == request_msg @@ -12278,7 +12278,7 @@ async def test_get_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetExclusionRequest() assert args[0] == request_msg @@ -12307,7 +12307,7 @@ async def test_create_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CreateExclusionRequest() assert args[0] == request_msg @@ -12336,7 +12336,7 @@ async def test_update_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateExclusionRequest() assert args[0] == request_msg @@ -12360,7 +12360,7 @@ async def test_delete_exclusion_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.DeleteExclusionRequest() assert args[0] == request_msg @@ -12389,7 +12389,7 @@ async def test_get_cmek_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetCmekSettingsRequest() assert args[0] == request_msg @@ -12418,7 +12418,7 @@ async def test_update_cmek_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateCmekSettingsRequest() assert args[0] == request_msg @@ -12448,7 +12448,7 @@ async def test_get_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.GetSettingsRequest() assert args[0] == request_msg @@ -12478,7 +12478,7 @@ async def test_update_settings_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.UpdateSettingsRequest() assert args[0] == request_msg @@ -12504,7 +12504,7 @@ async def test_copy_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_config.CopyLogEntriesRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index 954d48fd1a..dc5a94a1ef 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -2911,7 +2911,7 @@ def test_delete_log_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.DeleteLogRequest() assert args[0] == request_msg @@ -2933,7 +2933,7 @@ def test_write_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.WriteLogEntriesRequest() assert args[0] == request_msg @@ -2955,7 +2955,7 @@ def test_list_log_entries_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListLogEntriesRequest() assert args[0] == request_msg @@ -2977,7 +2977,7 @@ def test_list_monitored_resource_descriptors_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListMonitoredResourceDescriptorsRequest() assert args[0] == request_msg @@ -2999,7 +2999,7 @@ def test_list_logs_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListLogsRequest() assert args[0] == request_msg @@ -3030,7 +3030,7 @@ async def test_delete_log_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.DeleteLogRequest() assert args[0] == request_msg @@ -3055,7 +3055,7 @@ async def test_write_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.WriteLogEntriesRequest() assert args[0] == request_msg @@ -3081,7 +3081,7 @@ async def test_list_log_entries_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListLogEntriesRequest() assert args[0] == request_msg @@ -3107,7 +3107,7 @@ async def test_list_monitored_resource_descriptors_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListMonitoredResourceDescriptorsRequest() assert args[0] == request_msg @@ -3134,7 +3134,7 @@ async def test_list_logs_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging.ListLogsRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index f89049be56..64dab1eecb 100755 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -2698,7 +2698,7 @@ def test_list_log_metrics_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.ListLogMetricsRequest() assert args[0] == request_msg @@ -2720,7 +2720,7 @@ def test_get_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.GetLogMetricRequest() assert args[0] == request_msg @@ -2742,7 +2742,7 @@ def test_create_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.CreateLogMetricRequest() assert args[0] == request_msg @@ -2764,7 +2764,7 @@ def test_update_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.UpdateLogMetricRequest() assert args[0] == request_msg @@ -2786,7 +2786,7 @@ def test_delete_log_metric_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.DeleteLogMetricRequest() assert args[0] == request_msg @@ -2819,7 +2819,7 @@ async def test_list_log_metrics_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.ListLogMetricsRequest() assert args[0] == request_msg @@ -2851,7 +2851,7 @@ async def test_get_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.GetLogMetricRequest() assert args[0] == request_msg @@ -2883,7 +2883,7 @@ async def test_create_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.CreateLogMetricRequest() assert args[0] == request_msg @@ -2915,7 +2915,7 @@ async def test_update_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.UpdateLogMetricRequest() assert args[0] == request_msg @@ -2939,7 +2939,7 @@ async def test_delete_log_metric_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = logging_metrics.DeleteLogMetricRequest() assert args[0] == request_msg diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index 73666289c2..76a68fb5b3 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -7926,7 +7926,7 @@ def test_list_instances_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ListInstancesRequest() assert args[0] == request_msg @@ -7948,7 +7948,7 @@ def test_get_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.GetInstanceRequest() assert args[0] == request_msg @@ -7970,7 +7970,7 @@ def test_get_instance_auth_string_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.GetInstanceAuthStringRequest() assert args[0] == request_msg @@ -7992,7 +7992,7 @@ def test_create_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.CreateInstanceRequest() assert args[0] == request_msg @@ -8014,7 +8014,7 @@ def test_update_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.UpdateInstanceRequest() assert args[0] == request_msg @@ -8036,7 +8036,7 @@ def test_upgrade_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.UpgradeInstanceRequest() assert args[0] == request_msg @@ -8058,7 +8058,7 @@ def test_import_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ImportInstanceRequest() assert args[0] == request_msg @@ -8080,7 +8080,7 @@ def test_export_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ExportInstanceRequest() assert args[0] == request_msg @@ -8102,7 +8102,7 @@ def test_failover_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.FailoverInstanceRequest() assert args[0] == request_msg @@ -8124,7 +8124,7 @@ def test_delete_instance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.DeleteInstanceRequest() assert args[0] == request_msg @@ -8146,7 +8146,7 @@ def test_reschedule_maintenance_empty_call_grpc(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.RescheduleMaintenanceRequest() assert args[0] == request_msg @@ -8180,7 +8180,7 @@ async def test_list_instances_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ListInstancesRequest() assert args[0] == request_msg @@ -8232,7 +8232,7 @@ async def test_get_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.GetInstanceRequest() assert args[0] == request_msg @@ -8258,7 +8258,7 @@ async def test_get_instance_auth_string_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.GetInstanceAuthStringRequest() assert args[0] == request_msg @@ -8284,7 +8284,7 @@ async def test_create_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.CreateInstanceRequest() assert args[0] == request_msg @@ -8310,7 +8310,7 @@ async def test_update_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.UpdateInstanceRequest() assert args[0] == request_msg @@ -8336,7 +8336,7 @@ async def test_upgrade_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.UpgradeInstanceRequest() assert args[0] == request_msg @@ -8362,7 +8362,7 @@ async def test_import_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ImportInstanceRequest() assert args[0] == request_msg @@ -8388,7 +8388,7 @@ async def test_export_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.ExportInstanceRequest() assert args[0] == request_msg @@ -8414,7 +8414,7 @@ async def test_failover_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.FailoverInstanceRequest() assert args[0] == request_msg @@ -8440,7 +8440,7 @@ async def test_delete_instance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.DeleteInstanceRequest() assert args[0] == request_msg @@ -8466,7 +8466,7 @@ async def test_reschedule_maintenance_empty_call_grpc_asyncio(): # Establish that the underlying gRPC stub method was called. call.assert_called() - _, args, kw = call.mock_calls[0] + _, args, _ = call.mock_calls[0] request_msg = cloud_redis.RescheduleMaintenanceRequest() assert args[0] == request_msg