diff --git a/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index 475f9f3d3f13..69f0a9d8d860 100644 --- a/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -1,11 +1,21 @@ {% macro grpc_required_tests(method, service, api, full_extended_lro=False) %} +{%- set method_settings = api.all_method_settings.get(method.meta.address.proto) -%} +{%- set auto_populated_fields = method_settings.auto_populated_fields if method_settings else [] -%} +{%- set auto_populated_field_sample_value = "explicit value for autopopulate-able field" -%} {% with method_name = method.client_method_name|snake_case + "_unary" if method.extended_lro and not full_extended_lro else method.client_method_name|snake_case, method_output = method.extended_lro.operation_type if method.extended_lro and not full_extended_lro else method.output %} @pytest.mark.parametrize("request_type", [ - {{ method.input.ident }}, - dict, + {{ method.input.ident }}({ + {% for auto_populated_field in auto_populated_fields %} + "{{ auto_populated_field }}": "{{ auto_populated_field_sample_value }}", + {% endfor %} + }), + { + {% for auto_populated_field in auto_populated_fields %} + "{{ auto_populated_field }}": "{{ auto_populated_field_sample_value }}", + {% endfor %} + }, ]) def test_{{ method_name }}(request_type, transport: str = 'grpc'): - {% with auto_populated_field_sample_value = "explicit value for autopopulate-able field" %} client = {{ service.client_name }}( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -13,18 +23,7 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - {# Set UUID4 fields so that they are not automatically populated. #} - {% 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 %} - if isinstance(request, dict): - request['{{ auto_populated_field }}'] = "{{ auto_populated_field_sample_value }}" - else: - request.{{ auto_populated_field }} = "{{ auto_populated_field_sample_value }}" - {% endfor %} - {% endif %}{# if method_settings is not none #} - {% endwith %}{# method_settings #} + request = request_type {% if method.client_streaming %} requests = [request] {% endif %} @@ -71,13 +70,9 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): assert next(args[0]) == request {% else %} request = {{ method.input.ident }}() - {% 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 %} + {% for auto_populated_field in auto_populated_fields %} request.{{ auto_populated_field }} = "{{ auto_populated_field_sample_value }}" {% endfor %} - {% endif %}{# if method_settings is not none #} - {% endwith %}{# method_settings #} assert args[0] == request {% endif %} @@ -118,10 +113,9 @@ def test_{{ method_name }}(request_type, transport: str = 'grpc'): {% endif %}{# end oneof/optional #} {% endfor %} {% endif %} - {% endwith %}{# auto_populated_field_sample_value #} + {%- if not method.client_streaming %} -{% if not method.client_streaming %} 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. @@ -265,8 +259,19 @@ async def test_{{ method_name }}_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_{{ method_name }}_async(transport: str = 'grpc_asyncio', request_type={{ method.input.ident }}): - {% with auto_populated_field_sample_value = "explicit value for autopopulate-able field" %} +@pytest.mark.parametrize("request_type", [ + {{ method.input.ident }}({ + {%- for auto_populated_field in auto_populated_fields %} + "{{ auto_populated_field }}": "{{ auto_populated_field_sample_value }}", + {%- endfor %} + }), + { + {%- for auto_populated_field in auto_populated_fields %} + "{{ auto_populated_field }}": "{{ auto_populated_field_sample_value }}", + {%- endfor %} + }, +]) +async def test_{{ method_name }}_async(request_type, transport: str = 'grpc_asyncio'): client = {{ service.async_client_name }}( credentials=async_anonymous_credentials(), transport=transport, @@ -274,18 +279,7 @@ async def test_{{ method_name }}_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - {# Set UUID4 fields so that they are not automatically populated. #} - {% 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 %} - if isinstance(request, dict): - request['{{ auto_populated_field }}'] = "{{ auto_populated_field_sample_value }}" - else: - request.{{ auto_populated_field }} = "{{ auto_populated_field_sample_value }}" - {% endfor %} - {% endif %}{# if method_settings is not none #} - {% endwith %}{# method_settings #} + request = request_type {% if method.client_streaming %} requests = [request] {% endif %} @@ -335,13 +329,9 @@ async def test_{{ method_name }}_async(transport: str = 'grpc_asyncio', request_ assert next(args[0]) == request {% else %} request = {{ method.input.ident }}() - {% 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 %} + {% for auto_populated_field in auto_populated_fields %} request.{{ auto_populated_field }} = "{{ auto_populated_field_sample_value }}" {% endfor %} - {% endif %}{# if method_settings is not none #} - {% endwith %}{# method_settings #} assert args[0] == request {% endif %} @@ -378,12 +368,6 @@ async def test_{{ method_name }}_async(transport: str = 'grpc_asyncio', request_ {% endif %}{# oneof/optional #} {% endfor %} {% endif %} - {% endwith %}{# auto_populated_field_sample_value #} - - -@pytest.mark.asyncio -async def test_{{ method_name }}_async_from_dict(): - await test_{{ method_name }}_async(request_type=dict) {% endif %}{# full_extended_lro #} {% if method.field_headers and not method.client_streaming and not method.explicit_routing %} diff --git a/packages/gapic-generator/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/packages/gapic-generator/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 98a41f32aec8..5c20ad01106f 100755 --- a/packages/gapic-generator/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/packages/gapic-generator/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -965,8 +965,10 @@ def test_asset_service_client_create_channel_credentials_file(client_class, tran @pytest.mark.parametrize("request_type", [ - asset_service.ExportAssetsRequest, - dict, + asset_service.ExportAssetsRequest({ + }), + { + }, ]) def test_export_assets(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -976,7 +978,7 @@ def test_export_assets(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1100,7 +1102,11 @@ async def test_export_assets_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_export_assets_async(transport: str = 'grpc_asyncio', request_type=asset_service.ExportAssetsRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.ExportAssetsRequest({ }), + { }, +]) +async def test_export_assets_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1108,7 +1114,7 @@ async def test_export_assets_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1129,11 +1135,6 @@ async def test_export_assets_async(transport: str = 'grpc_asyncio', request_type # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -1198,8 +1199,10 @@ async def test_export_assets_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.ListAssetsRequest, - dict, + asset_service.ListAssetsRequest({ + }), + { + }, ]) def test_list_assets(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -1209,7 +1212,7 @@ def test_list_assets(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1328,7 +1331,11 @@ async def test_list_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_assets_async(transport: str = 'grpc_asyncio', request_type=asset_service.ListAssetsRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.ListAssetsRequest({ }), + { }, +]) +async def test_list_assets_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1336,7 +1343,7 @@ async def test_list_assets_async(transport: str = 'grpc_asyncio', request_type=a # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1358,11 +1365,6 @@ async def test_list_assets_async(transport: str = 'grpc_asyncio', request_type=a assert isinstance(response, pagers.ListAssetsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -1703,8 +1705,10 @@ async def test_list_assets_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.BatchGetAssetsHistoryRequest, - dict, + asset_service.BatchGetAssetsHistoryRequest({ + }), + { + }, ]) def test_batch_get_assets_history(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -1714,7 +1718,7 @@ def test_batch_get_assets_history(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1829,7 +1833,11 @@ async def test_batch_get_assets_history_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_batch_get_assets_history_async(transport: str = 'grpc_asyncio', request_type=asset_service.BatchGetAssetsHistoryRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.BatchGetAssetsHistoryRequest({ }), + { }, +]) +async def test_batch_get_assets_history_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1837,7 +1845,7 @@ async def test_batch_get_assets_history_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1857,11 +1865,6 @@ async def test_batch_get_assets_history_async(transport: str = 'grpc_asyncio', r # Establish that the response is the type that we expect. assert isinstance(response, asset_service.BatchGetAssetsHistoryResponse) - -@pytest.mark.asyncio -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(), @@ -1926,8 +1929,10 @@ async def test_batch_get_assets_history_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.CreateFeedRequest, - dict, + asset_service.CreateFeedRequest({ + }), + { + }, ]) def test_create_feed(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -1937,7 +1942,7 @@ def test_create_feed(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2064,7 +2069,11 @@ async def test_create_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_feed_async(transport: str = 'grpc_asyncio', request_type=asset_service.CreateFeedRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.CreateFeedRequest({ }), + { }, +]) +async def test_create_feed_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2072,7 +2081,7 @@ async def test_create_feed_async(transport: str = 'grpc_asyncio', request_type=a # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2102,11 +2111,6 @@ async def test_create_feed_async(transport: str = 'grpc_asyncio', request_type=a assert response.content_type == asset_service.ContentType.RESOURCE assert response.relationship_types == ['relationship_types_value'] - -@pytest.mark.asyncio -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(), @@ -2253,8 +2257,10 @@ async def test_create_feed_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.GetFeedRequest, - dict, + asset_service.GetFeedRequest({ + }), + { + }, ]) def test_get_feed(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -2264,7 +2270,7 @@ def test_get_feed(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2389,7 +2395,11 @@ async def test_get_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_feed_async(transport: str = 'grpc_asyncio', request_type=asset_service.GetFeedRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.GetFeedRequest({ }), + { }, +]) +async def test_get_feed_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2397,7 +2407,7 @@ async def test_get_feed_async(transport: str = 'grpc_asyncio', request_type=asse # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2427,11 +2437,6 @@ async def test_get_feed_async(transport: str = 'grpc_asyncio', request_type=asse assert response.content_type == asset_service.ContentType.RESOURCE assert response.relationship_types == ['relationship_types_value'] - -@pytest.mark.asyncio -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(), @@ -2578,8 +2583,10 @@ async def test_get_feed_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.ListFeedsRequest, - dict, + asset_service.ListFeedsRequest({ + }), + { + }, ]) def test_list_feeds(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -2589,7 +2596,7 @@ def test_list_feeds(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2704,7 +2711,11 @@ async def test_list_feeds_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_feeds_async(transport: str = 'grpc_asyncio', request_type=asset_service.ListFeedsRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.ListFeedsRequest({ }), + { }, +]) +async def test_list_feeds_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2712,7 +2723,7 @@ async def test_list_feeds_async(transport: str = 'grpc_asyncio', request_type=as # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2732,11 +2743,6 @@ async def test_list_feeds_async(transport: str = 'grpc_asyncio', request_type=as # Establish that the response is the type that we expect. assert isinstance(response, asset_service.ListFeedsResponse) - -@pytest.mark.asyncio -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(), @@ -2883,8 +2889,10 @@ async def test_list_feeds_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.UpdateFeedRequest, - dict, + asset_service.UpdateFeedRequest({ + }), + { + }, ]) def test_update_feed(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -2894,7 +2902,7 @@ def test_update_feed(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3017,7 +3025,11 @@ async def test_update_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_feed_async(transport: str = 'grpc_asyncio', request_type=asset_service.UpdateFeedRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.UpdateFeedRequest({ }), + { }, +]) +async def test_update_feed_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3025,7 +3037,7 @@ async def test_update_feed_async(transport: str = 'grpc_asyncio', request_type=a # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3055,11 +3067,6 @@ async def test_update_feed_async(transport: str = 'grpc_asyncio', request_type=a assert response.content_type == asset_service.ContentType.RESOURCE assert response.relationship_types == ['relationship_types_value'] - -@pytest.mark.asyncio -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(), @@ -3206,8 +3213,10 @@ async def test_update_feed_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.DeleteFeedRequest, - dict, + asset_service.DeleteFeedRequest({ + }), + { + }, ]) def test_delete_feed(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -3217,7 +3226,7 @@ def test_delete_feed(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3331,7 +3340,11 @@ async def test_delete_feed_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_feed_async(transport: str = 'grpc_asyncio', request_type=asset_service.DeleteFeedRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.DeleteFeedRequest({ }), + { }, +]) +async def test_delete_feed_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3339,7 +3352,7 @@ async def test_delete_feed_async(transport: str = 'grpc_asyncio', request_type=a # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3358,11 +3371,6 @@ async def test_delete_feed_async(transport: str = 'grpc_asyncio', request_type=a # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -3509,8 +3517,10 @@ async def test_delete_feed_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.SearchAllResourcesRequest, - dict, + asset_service.SearchAllResourcesRequest({ + }), + { + }, ]) def test_search_all_resources(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -3520,7 +3530,7 @@ def test_search_all_resources(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3643,7 +3653,11 @@ async def test_search_all_resources_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_search_all_resources_async(transport: str = 'grpc_asyncio', request_type=asset_service.SearchAllResourcesRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.SearchAllResourcesRequest({ }), + { }, +]) +async def test_search_all_resources_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3651,7 +3665,7 @@ async def test_search_all_resources_async(transport: str = 'grpc_asyncio', reque # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3673,11 +3687,6 @@ async def test_search_all_resources_async(transport: str = 'grpc_asyncio', reque assert isinstance(response, pagers.SearchAllResourcesAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -4038,8 +4047,10 @@ async def test_search_all_resources_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.SearchAllIamPoliciesRequest, - dict, + asset_service.SearchAllIamPoliciesRequest({ + }), + { + }, ]) def test_search_all_iam_policies(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -4049,7 +4060,7 @@ def test_search_all_iam_policies(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4172,7 +4183,11 @@ async def test_search_all_iam_policies_async_use_cached_wrapped_rpc(transport: s assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_search_all_iam_policies_async(transport: str = 'grpc_asyncio', request_type=asset_service.SearchAllIamPoliciesRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.SearchAllIamPoliciesRequest({ }), + { }, +]) +async def test_search_all_iam_policies_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4180,7 +4195,7 @@ async def test_search_all_iam_policies_async(transport: str = 'grpc_asyncio', re # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4202,11 +4217,6 @@ async def test_search_all_iam_policies_async(transport: str = 'grpc_asyncio', re assert isinstance(response, pagers.SearchAllIamPoliciesAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -4557,8 +4567,10 @@ async def test_search_all_iam_policies_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeIamPolicyRequest, - dict, + asset_service.AnalyzeIamPolicyRequest({ + }), + { + }, ]) def test_analyze_iam_policy(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -4568,7 +4580,7 @@ def test_analyze_iam_policy(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4685,7 +4697,11 @@ async def test_analyze_iam_policy_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_iam_policy_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeIamPolicyRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeIamPolicyRequest({ }), + { }, +]) +async def test_analyze_iam_policy_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4693,7 +4709,7 @@ async def test_analyze_iam_policy_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4715,11 +4731,6 @@ async def test_analyze_iam_policy_async(transport: str = 'grpc_asyncio', request assert isinstance(response, asset_service.AnalyzeIamPolicyResponse) assert response.fully_explored is True - -@pytest.mark.asyncio -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(), @@ -4784,8 +4795,10 @@ async def test_analyze_iam_policy_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeIamPolicyLongrunningRequest, - dict, + asset_service.AnalyzeIamPolicyLongrunningRequest({ + }), + { + }, ]) def test_analyze_iam_policy_longrunning(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -4795,7 +4808,7 @@ def test_analyze_iam_policy_longrunning(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4919,7 +4932,11 @@ async def test_analyze_iam_policy_longrunning_async_use_cached_wrapped_rpc(trans assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_iam_policy_longrunning_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeIamPolicyLongrunningRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeIamPolicyLongrunningRequest({ }), + { }, +]) +async def test_analyze_iam_policy_longrunning_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4927,7 +4944,7 @@ async def test_analyze_iam_policy_longrunning_async(transport: str = 'grpc_async # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4948,11 +4965,6 @@ async def test_analyze_iam_policy_longrunning_async(transport: str = 'grpc_async # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -5017,8 +5029,10 @@ async def test_analyze_iam_policy_longrunning_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeMoveRequest, - dict, + asset_service.AnalyzeMoveRequest({ + }), + { + }, ]) def test_analyze_move(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -5028,7 +5042,7 @@ def test_analyze_move(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5145,7 +5159,11 @@ async def test_analyze_move_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_move_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeMoveRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeMoveRequest({ }), + { }, +]) +async def test_analyze_move_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5153,7 +5171,7 @@ async def test_analyze_move_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5173,11 +5191,6 @@ async def test_analyze_move_async(transport: str = 'grpc_asyncio', request_type= # Establish that the response is the type that we expect. assert isinstance(response, asset_service.AnalyzeMoveResponse) - -@pytest.mark.asyncio -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(), @@ -5242,8 +5255,10 @@ async def test_analyze_move_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.QueryAssetsRequest, - dict, + asset_service.QueryAssetsRequest({ + }), + { + }, ]) def test_query_assets(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -5253,7 +5268,7 @@ def test_query_assets(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5378,7 +5393,11 @@ async def test_query_assets_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_query_assets_async(transport: str = 'grpc_asyncio', request_type=asset_service.QueryAssetsRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.QueryAssetsRequest({ }), + { }, +]) +async def test_query_assets_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5386,7 +5405,7 @@ async def test_query_assets_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5410,11 +5429,6 @@ async def test_query_assets_async(transport: str = 'grpc_asyncio', request_type= assert response.job_reference == 'job_reference_value' assert response.done is True - -@pytest.mark.asyncio -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(), @@ -5479,8 +5493,10 @@ async def test_query_assets_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.CreateSavedQueryRequest, - dict, + asset_service.CreateSavedQueryRequest({ + }), + { + }, ]) def test_create_saved_query(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -5490,7 +5506,7 @@ def test_create_saved_query(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5615,7 +5631,11 @@ async def test_create_saved_query_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_saved_query_async(transport: str = 'grpc_asyncio', request_type=asset_service.CreateSavedQueryRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.CreateSavedQueryRequest({ }), + { }, +]) +async def test_create_saved_query_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5623,7 +5643,7 @@ async def test_create_saved_query_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5651,11 +5671,6 @@ async def test_create_saved_query_async(transport: str = 'grpc_asyncio', request assert response.creator == 'creator_value' assert response.last_updater == 'last_updater_value' - -@pytest.mark.asyncio -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(), @@ -5822,8 +5837,10 @@ async def test_create_saved_query_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.GetSavedQueryRequest, - dict, + asset_service.GetSavedQueryRequest({ + }), + { + }, ]) def test_get_saved_query(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -5833,7 +5850,7 @@ def test_get_saved_query(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5956,7 +5973,11 @@ async def test_get_saved_query_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_saved_query_async(transport: str = 'grpc_asyncio', request_type=asset_service.GetSavedQueryRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.GetSavedQueryRequest({ }), + { }, +]) +async def test_get_saved_query_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5964,7 +5985,7 @@ async def test_get_saved_query_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5992,11 +6013,6 @@ async def test_get_saved_query_async(transport: str = 'grpc_asyncio', request_ty assert response.creator == 'creator_value' assert response.last_updater == 'last_updater_value' - -@pytest.mark.asyncio -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(), @@ -6143,8 +6159,10 @@ async def test_get_saved_query_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.ListSavedQueriesRequest, - dict, + asset_service.ListSavedQueriesRequest({ + }), + { + }, ]) def test_list_saved_queries(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -6154,7 +6172,7 @@ def test_list_saved_queries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6275,7 +6293,11 @@ async def test_list_saved_queries_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_saved_queries_async(transport: str = 'grpc_asyncio', request_type=asset_service.ListSavedQueriesRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.ListSavedQueriesRequest({ }), + { }, +]) +async def test_list_saved_queries_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6283,7 +6305,7 @@ async def test_list_saved_queries_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6305,11 +6327,6 @@ async def test_list_saved_queries_async(transport: str = 'grpc_asyncio', request assert isinstance(response, pagers.ListSavedQueriesAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -6650,8 +6667,10 @@ async def test_list_saved_queries_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.UpdateSavedQueryRequest, - dict, + asset_service.UpdateSavedQueryRequest({ + }), + { + }, ]) def test_update_saved_query(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -6661,7 +6680,7 @@ def test_update_saved_query(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6782,7 +6801,11 @@ async def test_update_saved_query_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_saved_query_async(transport: str = 'grpc_asyncio', request_type=asset_service.UpdateSavedQueryRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.UpdateSavedQueryRequest({ }), + { }, +]) +async def test_update_saved_query_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6790,7 +6813,7 @@ async def test_update_saved_query_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6818,11 +6841,6 @@ async def test_update_saved_query_async(transport: str = 'grpc_asyncio', request assert response.creator == 'creator_value' assert response.last_updater == 'last_updater_value' - -@pytest.mark.asyncio -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(), @@ -6979,8 +6997,10 @@ async def test_update_saved_query_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.DeleteSavedQueryRequest, - dict, + asset_service.DeleteSavedQueryRequest({ + }), + { + }, ]) def test_delete_saved_query(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -6990,7 +7010,7 @@ def test_delete_saved_query(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7104,7 +7124,11 @@ async def test_delete_saved_query_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_saved_query_async(transport: str = 'grpc_asyncio', request_type=asset_service.DeleteSavedQueryRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.DeleteSavedQueryRequest({ }), + { }, +]) +async def test_delete_saved_query_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7112,7 +7136,7 @@ async def test_delete_saved_query_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7131,11 +7155,6 @@ async def test_delete_saved_query_async(transport: str = 'grpc_asyncio', request # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -7282,8 +7301,10 @@ async def test_delete_saved_query_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - asset_service.BatchGetEffectiveIamPoliciesRequest, - dict, + asset_service.BatchGetEffectiveIamPoliciesRequest({ + }), + { + }, ]) def test_batch_get_effective_iam_policies(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -7293,7 +7314,7 @@ def test_batch_get_effective_iam_policies(request_type, transport: str = 'grpc') # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7408,7 +7429,11 @@ async def test_batch_get_effective_iam_policies_async_use_cached_wrapped_rpc(tra assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_batch_get_effective_iam_policies_async(transport: str = 'grpc_asyncio', request_type=asset_service.BatchGetEffectiveIamPoliciesRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.BatchGetEffectiveIamPoliciesRequest({ }), + { }, +]) +async def test_batch_get_effective_iam_policies_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7416,7 +7441,7 @@ async def test_batch_get_effective_iam_policies_async(transport: str = 'grpc_asy # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7436,11 +7461,6 @@ async def test_batch_get_effective_iam_policies_async(transport: str = 'grpc_asy # Establish that the response is the type that we expect. assert isinstance(response, asset_service.BatchGetEffectiveIamPoliciesResponse) - -@pytest.mark.asyncio -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(), @@ -7505,8 +7525,10 @@ async def test_batch_get_effective_iam_policies_field_headers_async(): @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeOrgPoliciesRequest, - dict, + asset_service.AnalyzeOrgPoliciesRequest({ + }), + { + }, ]) def test_analyze_org_policies(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -7516,7 +7538,7 @@ def test_analyze_org_policies(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7639,7 +7661,11 @@ async def test_analyze_org_policies_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_org_policies_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeOrgPoliciesRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeOrgPoliciesRequest({ }), + { }, +]) +async def test_analyze_org_policies_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7647,7 +7673,7 @@ async def test_analyze_org_policies_async(transport: str = 'grpc_asyncio', reque # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7669,11 +7695,6 @@ async def test_analyze_org_policies_async(transport: str = 'grpc_asyncio', reque assert isinstance(response, pagers.AnalyzeOrgPoliciesAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -8034,8 +8055,10 @@ async def test_analyze_org_policies_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeOrgPolicyGovernedContainersRequest, - dict, + asset_service.AnalyzeOrgPolicyGovernedContainersRequest({ + }), + { + }, ]) def test_analyze_org_policy_governed_containers(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -8045,7 +8068,7 @@ def test_analyze_org_policy_governed_containers(request_type, transport: str = ' # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8168,7 +8191,11 @@ async def test_analyze_org_policy_governed_containers_async_use_cached_wrapped_r assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_org_policy_governed_containers_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeOrgPolicyGovernedContainersRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeOrgPolicyGovernedContainersRequest({ }), + { }, +]) +async def test_analyze_org_policy_governed_containers_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8176,7 +8203,7 @@ async def test_analyze_org_policy_governed_containers_async(transport: str = 'gr # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8198,11 +8225,6 @@ async def test_analyze_org_policy_governed_containers_async(transport: str = 'gr assert isinstance(response, pagers.AnalyzeOrgPolicyGovernedContainersAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -8563,8 +8585,10 @@ async def test_analyze_org_policy_governed_containers_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - asset_service.AnalyzeOrgPolicyGovernedAssetsRequest, - dict, + asset_service.AnalyzeOrgPolicyGovernedAssetsRequest({ + }), + { + }, ]) def test_analyze_org_policy_governed_assets(request_type, transport: str = 'grpc'): client = AssetServiceClient( @@ -8574,7 +8598,7 @@ def test_analyze_org_policy_governed_assets(request_type, transport: str = 'grpc # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8697,7 +8721,11 @@ async def test_analyze_org_policy_governed_assets_async_use_cached_wrapped_rpc(t assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_analyze_org_policy_governed_assets_async(transport: str = 'grpc_asyncio', request_type=asset_service.AnalyzeOrgPolicyGovernedAssetsRequest): +@pytest.mark.parametrize("request_type", [ + asset_service.AnalyzeOrgPolicyGovernedAssetsRequest({ }), + { }, +]) +async def test_analyze_org_policy_governed_assets_async(request_type, transport: str = 'grpc_asyncio'): client = AssetServiceAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8705,7 +8733,7 @@ async def test_analyze_org_policy_governed_assets_async(transport: str = 'grpc_a # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8727,11 +8755,6 @@ async def test_analyze_org_policy_governed_assets_async(transport: str = 'grpc_a assert isinstance(response, pagers.AnalyzeOrgPolicyGovernedAssetsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), diff --git a/packages/gapic-generator/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/packages/gapic-generator/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 74fa9dbfb423..0b4df5edaaa6 100755 --- a/packages/gapic-generator/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/packages/gapic-generator/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -955,8 +955,10 @@ def test_iam_credentials_client_create_channel_credentials_file(client_class, tr @pytest.mark.parametrize("request_type", [ - common.GenerateAccessTokenRequest, - dict, + common.GenerateAccessTokenRequest({ + }), + { + }, ]) def test_generate_access_token(request_type, transport: str = 'grpc'): client = IAMCredentialsClient( @@ -966,7 +968,7 @@ def test_generate_access_token(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1083,7 +1085,11 @@ async def test_generate_access_token_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_generate_access_token_async(transport: str = 'grpc_asyncio', request_type=common.GenerateAccessTokenRequest): +@pytest.mark.parametrize("request_type", [ + common.GenerateAccessTokenRequest({ }), + { }, +]) +async def test_generate_access_token_async(request_type, transport: str = 'grpc_asyncio'): client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1091,7 +1097,7 @@ async def test_generate_access_token_async(transport: str = 'grpc_asyncio', requ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1113,11 +1119,6 @@ async def test_generate_access_token_async(transport: str = 'grpc_asyncio', requ assert isinstance(response, common.GenerateAccessTokenResponse) assert response.access_token == 'access_token_value' - -@pytest.mark.asyncio -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(), @@ -1290,8 +1291,10 @@ async def test_generate_access_token_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - common.GenerateIdTokenRequest, - dict, + common.GenerateIdTokenRequest({ + }), + { + }, ]) def test_generate_id_token(request_type, transport: str = 'grpc'): client = IAMCredentialsClient( @@ -1301,7 +1304,7 @@ def test_generate_id_token(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1420,7 +1423,11 @@ async def test_generate_id_token_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_generate_id_token_async(transport: str = 'grpc_asyncio', request_type=common.GenerateIdTokenRequest): +@pytest.mark.parametrize("request_type", [ + common.GenerateIdTokenRequest({ }), + { }, +]) +async def test_generate_id_token_async(request_type, transport: str = 'grpc_asyncio'): client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1428,7 +1435,7 @@ async def test_generate_id_token_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1450,11 +1457,6 @@ async def test_generate_id_token_async(transport: str = 'grpc_asyncio', request_ assert isinstance(response, common.GenerateIdTokenResponse) assert response.token == 'token_value' - -@pytest.mark.asyncio -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(), @@ -1631,8 +1633,10 @@ async def test_generate_id_token_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - common.SignBlobRequest, - dict, + common.SignBlobRequest({ + }), + { + }, ]) def test_sign_blob(request_type, transport: str = 'grpc'): client = IAMCredentialsClient( @@ -1642,7 +1646,7 @@ def test_sign_blob(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1761,7 +1765,11 @@ async def test_sign_blob_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_sign_blob_async(transport: str = 'grpc_asyncio', request_type=common.SignBlobRequest): +@pytest.mark.parametrize("request_type", [ + common.SignBlobRequest({ }), + { }, +]) +async def test_sign_blob_async(request_type, transport: str = 'grpc_asyncio'): client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1769,7 +1777,7 @@ async def test_sign_blob_async(transport: str = 'grpc_asyncio', request_type=com # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1793,11 +1801,6 @@ async def test_sign_blob_async(transport: str = 'grpc_asyncio', request_type=com assert response.key_id == 'key_id_value' assert response.signed_blob == b'signed_blob_blob' - -@pytest.mark.asyncio -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(), @@ -1964,8 +1967,10 @@ async def test_sign_blob_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - common.SignJwtRequest, - dict, + common.SignJwtRequest({ + }), + { + }, ]) def test_sign_jwt(request_type, transport: str = 'grpc'): client = IAMCredentialsClient( @@ -1975,7 +1980,7 @@ def test_sign_jwt(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2096,7 +2101,11 @@ async def test_sign_jwt_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_sign_jwt_async(transport: str = 'grpc_asyncio', request_type=common.SignJwtRequest): +@pytest.mark.parametrize("request_type", [ + common.SignJwtRequest({ }), + { }, +]) +async def test_sign_jwt_async(request_type, transport: str = 'grpc_asyncio'): client = IAMCredentialsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2104,7 +2113,7 @@ async def test_sign_jwt_async(transport: str = 'grpc_asyncio', request_type=comm # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2128,11 +2137,6 @@ async def test_sign_jwt_async(transport: str = 'grpc_asyncio', request_type=comm assert response.key_id == 'key_id_value' assert response.signed_jwt == 'signed_jwt_value' - -@pytest.mark.asyncio -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(), diff --git a/packages/gapic-generator/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/packages/gapic-generator/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index d9f10062c6e3..ae46f4d8401e 100755 --- a/packages/gapic-generator/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/packages/gapic-generator/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -986,8 +986,10 @@ def test_eventarc_client_create_channel_credentials_file(client_class, transport @pytest.mark.parametrize("request_type", [ - eventarc.GetTriggerRequest, - dict, + eventarc.GetTriggerRequest({ + }), + { + }, ]) def test_get_trigger(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -997,7 +999,7 @@ def test_get_trigger(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1126,7 +1128,11 @@ async def test_get_trigger_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_trigger_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetTriggerRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetTriggerRequest({ }), + { }, +]) +async def test_get_trigger_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1134,7 +1140,7 @@ async def test_get_trigger_async(transport: str = 'grpc_asyncio', request_type=e # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1168,11 +1174,6 @@ async def test_get_trigger_async(transport: str = 'grpc_asyncio', request_type=e assert response.satisfies_pzs is True assert response.etag == 'etag_value' - -@pytest.mark.asyncio -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(), @@ -1319,8 +1320,10 @@ async def test_get_trigger_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListTriggersRequest, - dict, + eventarc.ListTriggersRequest({ + }), + { + }, ]) def test_list_triggers(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -1330,7 +1333,7 @@ def test_list_triggers(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1455,7 +1458,11 @@ async def test_list_triggers_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_triggers_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListTriggersRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListTriggersRequest({ }), + { }, +]) +async def test_list_triggers_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1463,7 +1470,7 @@ async def test_list_triggers_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1487,11 +1494,6 @@ async def test_list_triggers_async(transport: str = 'grpc_asyncio', request_type assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -1832,8 +1834,10 @@ async def test_list_triggers_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateTriggerRequest, - dict, + eventarc.CreateTriggerRequest({ + }), + { + }, ]) def test_create_trigger(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -1843,7 +1847,7 @@ def test_create_trigger(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1969,7 +1973,11 @@ async def test_create_trigger_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_trigger_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateTriggerRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateTriggerRequest({ }), + { }, +]) +async def test_create_trigger_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1977,7 +1985,7 @@ async def test_create_trigger_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1998,11 +2006,6 @@ async def test_create_trigger_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2171,8 +2174,10 @@ async def test_create_trigger_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateTriggerRequest, - dict, + eventarc.UpdateTriggerRequest({ + }), + { + }, ]) def test_update_trigger(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -2182,7 +2187,7 @@ def test_update_trigger(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2304,7 +2309,11 @@ async def test_update_trigger_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_trigger_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateTriggerRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateTriggerRequest({ }), + { }, +]) +async def test_update_trigger_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2312,7 +2321,7 @@ async def test_update_trigger_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2333,11 +2342,6 @@ async def test_update_trigger_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2506,8 +2510,10 @@ async def test_update_trigger_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteTriggerRequest, - dict, + eventarc.DeleteTriggerRequest({ + }), + { + }, ]) def test_delete_trigger(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -2517,7 +2523,7 @@ def test_delete_trigger(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2643,7 +2649,11 @@ async def test_delete_trigger_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_trigger_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteTriggerRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteTriggerRequest({ }), + { }, +]) +async def test_delete_trigger_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2651,7 +2661,7 @@ async def test_delete_trigger_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2672,11 +2682,6 @@ async def test_delete_trigger_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2835,8 +2840,10 @@ async def test_delete_trigger_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetChannelRequest, - dict, + eventarc.GetChannelRequest({ + }), + { + }, ]) def test_get_channel(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -2846,7 +2853,7 @@ def test_get_channel(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2976,7 +2983,11 @@ async def test_get_channel_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_channel_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetChannelRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetChannelRequest({ }), + { }, +]) +async def test_get_channel_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2984,7 +2995,7 @@ async def test_get_channel_async(transport: str = 'grpc_asyncio', request_type=e # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3018,11 +3029,6 @@ async def test_get_channel_async(transport: str = 'grpc_asyncio', request_type=e assert response.crypto_key_name == 'crypto_key_name_value' assert response.satisfies_pzs is True - -@pytest.mark.asyncio -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(), @@ -3169,8 +3175,10 @@ async def test_get_channel_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListChannelsRequest, - dict, + eventarc.ListChannelsRequest({ + }), + { + }, ]) def test_list_channels(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -3180,7 +3188,7 @@ def test_list_channels(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3303,7 +3311,11 @@ async def test_list_channels_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_channels_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListChannelsRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListChannelsRequest({ }), + { }, +]) +async def test_list_channels_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3311,7 +3323,7 @@ async def test_list_channels_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3335,11 +3347,6 @@ async def test_list_channels_async(transport: str = 'grpc_asyncio', request_type assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -3680,8 +3687,10 @@ async def test_list_channels_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateChannelRequest, - dict, + eventarc.CreateChannelRequest({ + }), + { + }, ]) def test_create_channel(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -3691,7 +3700,7 @@ def test_create_channel(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3817,7 +3826,11 @@ async def test_create_channel_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_channel_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateChannelRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateChannelRequest({ }), + { }, +]) +async def test_create_channel_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3825,7 +3838,7 @@ async def test_create_channel_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3846,11 +3859,6 @@ async def test_create_channel_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -4019,8 +4027,10 @@ async def test_create_channel_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateChannelRequest, - dict, + eventarc.UpdateChannelRequest({ + }), + { + }, ]) def test_update_channel(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -4030,7 +4040,7 @@ def test_update_channel(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4152,7 +4162,11 @@ async def test_update_channel_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_channel_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateChannelRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateChannelRequest({ }), + { }, +]) +async def test_update_channel_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4160,7 +4174,7 @@ async def test_update_channel_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4181,11 +4195,6 @@ async def test_update_channel_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -4344,8 +4353,10 @@ async def test_update_channel_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteChannelRequest, - dict, + eventarc.DeleteChannelRequest({ + }), + { + }, ]) def test_delete_channel(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -4355,7 +4366,7 @@ def test_delete_channel(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4479,7 +4490,11 @@ async def test_delete_channel_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_channel_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteChannelRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteChannelRequest({ }), + { }, +]) +async def test_delete_channel_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4487,7 +4502,7 @@ async def test_delete_channel_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4508,11 +4523,6 @@ async def test_delete_channel_async(transport: str = 'grpc_asyncio', request_typ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -4661,8 +4671,10 @@ async def test_delete_channel_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetProviderRequest, - dict, + eventarc.GetProviderRequest({ + }), + { + }, ]) def test_get_provider(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -4672,7 +4684,7 @@ def test_get_provider(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4791,7 +4803,11 @@ async def test_get_provider_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_provider_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetProviderRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetProviderRequest({ }), + { }, +]) +async def test_get_provider_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4799,7 +4815,7 @@ async def test_get_provider_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4823,11 +4839,6 @@ async def test_get_provider_async(transport: str = 'grpc_asyncio', request_type= assert response.name == 'name_value' assert response.display_name == 'display_name_value' - -@pytest.mark.asyncio -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(), @@ -4974,8 +4985,10 @@ async def test_get_provider_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListProvidersRequest, - dict, + eventarc.ListProvidersRequest({ + }), + { + }, ]) def test_list_providers(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -4985,7 +4998,7 @@ def test_list_providers(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5110,7 +5123,11 @@ async def test_list_providers_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_providers_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListProvidersRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListProvidersRequest({ }), + { }, +]) +async def test_list_providers_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5118,7 +5135,7 @@ async def test_list_providers_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5142,11 +5159,6 @@ async def test_list_providers_async(transport: str = 'grpc_asyncio', request_typ assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -5487,8 +5499,10 @@ async def test_list_providers_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.GetChannelConnectionRequest, - dict, + eventarc.GetChannelConnectionRequest({ + }), + { + }, ]) def test_get_channel_connection(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -5498,7 +5512,7 @@ def test_get_channel_connection(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5621,7 +5635,11 @@ async def test_get_channel_connection_async_use_cached_wrapped_rpc(transport: st assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_channel_connection_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetChannelConnectionRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetChannelConnectionRequest({ }), + { }, +]) +async def test_get_channel_connection_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5629,7 +5647,7 @@ async def test_get_channel_connection_async(transport: str = 'grpc_asyncio', req # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5657,11 +5675,6 @@ async def test_get_channel_connection_async(transport: str = 'grpc_asyncio', req assert response.channel == 'channel_value' assert response.activation_token == 'activation_token_value' - -@pytest.mark.asyncio -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(), @@ -5808,8 +5821,10 @@ async def test_get_channel_connection_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListChannelConnectionsRequest, - dict, + eventarc.ListChannelConnectionsRequest({ + }), + { + }, ]) def test_list_channel_connections(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -5819,7 +5834,7 @@ def test_list_channel_connections(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5940,7 +5955,11 @@ async def test_list_channel_connections_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_channel_connections_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListChannelConnectionsRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListChannelConnectionsRequest({ }), + { }, +]) +async def test_list_channel_connections_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5948,7 +5967,7 @@ async def test_list_channel_connections_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5972,11 +5991,6 @@ async def test_list_channel_connections_async(transport: str = 'grpc_asyncio', r assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -6317,8 +6331,10 @@ async def test_list_channel_connections_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateChannelConnectionRequest, - dict, + eventarc.CreateChannelConnectionRequest({ + }), + { + }, ]) def test_create_channel_connection(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -6328,7 +6344,7 @@ def test_create_channel_connection(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6454,7 +6470,11 @@ async def test_create_channel_connection_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_channel_connection_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateChannelConnectionRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateChannelConnectionRequest({ }), + { }, +]) +async def test_create_channel_connection_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6462,7 +6482,7 @@ async def test_create_channel_connection_async(transport: str = 'grpc_asyncio', # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6483,11 +6503,6 @@ async def test_create_channel_connection_async(transport: str = 'grpc_asyncio', # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.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(), @@ -6656,8 +6671,10 @@ async def test_create_channel_connection_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteChannelConnectionRequest, - dict, + eventarc.DeleteChannelConnectionRequest({ + }), + { + }, ]) def test_delete_channel_connection(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -6667,7 +6684,7 @@ def test_delete_channel_connection(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6791,7 +6808,11 @@ async def test_delete_channel_connection_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_channel_connection_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteChannelConnectionRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteChannelConnectionRequest({ }), + { }, +]) +async def test_delete_channel_connection_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6799,7 +6820,7 @@ async def test_delete_channel_connection_async(transport: str = 'grpc_asyncio', # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6820,11 +6841,6 @@ async def test_delete_channel_connection_async(transport: str = 'grpc_asyncio', # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.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(), @@ -6973,8 +6989,10 @@ async def test_delete_channel_connection_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetGoogleChannelConfigRequest, - dict, + eventarc.GetGoogleChannelConfigRequest({ + }), + { + }, ]) def test_get_google_channel_config(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -6984,7 +7002,7 @@ def test_get_google_channel_config(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7103,7 +7121,11 @@ async def test_get_google_channel_config_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_google_channel_config_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetGoogleChannelConfigRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetGoogleChannelConfigRequest({ }), + { }, +]) +async def test_get_google_channel_config_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7111,7 +7133,7 @@ async def test_get_google_channel_config_async(transport: str = 'grpc_asyncio', # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7135,11 +7157,6 @@ async def test_get_google_channel_config_async(transport: str = 'grpc_asyncio', assert response.name == 'name_value' assert response.crypto_key_name == 'crypto_key_name_value' - -@pytest.mark.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(), @@ -7286,8 +7303,10 @@ async def test_get_google_channel_config_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateGoogleChannelConfigRequest, - dict, + eventarc.UpdateGoogleChannelConfigRequest({ + }), + { + }, ]) def test_update_google_channel_config(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -7297,7 +7316,7 @@ def test_update_google_channel_config(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7414,7 +7433,11 @@ async def test_update_google_channel_config_async_use_cached_wrapped_rpc(transpo assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_google_channel_config_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateGoogleChannelConfigRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateGoogleChannelConfigRequest({ }), + { }, +]) +async def test_update_google_channel_config_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7422,7 +7445,7 @@ async def test_update_google_channel_config_async(transport: str = 'grpc_asyncio # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7446,11 +7469,6 @@ async def test_update_google_channel_config_async(transport: str = 'grpc_asyncio assert response.name == 'name_value' assert response.crypto_key_name == 'crypto_key_name_value' - -@pytest.mark.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(), @@ -7607,8 +7625,10 @@ async def test_update_google_channel_config_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetMessageBusRequest, - dict, + eventarc.GetMessageBusRequest({ + }), + { + }, ]) def test_get_message_bus(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -7618,7 +7638,7 @@ def test_get_message_bus(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7743,7 +7763,11 @@ async def test_get_message_bus_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_message_bus_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetMessageBusRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetMessageBusRequest({ }), + { }, +]) +async def test_get_message_bus_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7751,7 +7775,7 @@ async def test_get_message_bus_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7781,11 +7805,6 @@ async def test_get_message_bus_async(transport: str = 'grpc_asyncio', request_ty assert response.display_name == 'display_name_value' assert response.crypto_key_name == 'crypto_key_name_value' - -@pytest.mark.asyncio -async def test_get_message_bus_async_from_dict(): - await test_get_message_bus_async(request_type=dict) - def test_get_message_bus_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -7932,8 +7951,10 @@ async def test_get_message_bus_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListMessageBusesRequest, - dict, + eventarc.ListMessageBusesRequest({ + }), + { + }, ]) def test_list_message_buses(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -7943,7 +7964,7 @@ def test_list_message_buses(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8068,7 +8089,11 @@ async def test_list_message_buses_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_message_buses_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListMessageBusesRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListMessageBusesRequest({ }), + { }, +]) +async def test_list_message_buses_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8076,7 +8101,7 @@ async def test_list_message_buses_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8100,11 +8125,6 @@ async def test_list_message_buses_async(transport: str = 'grpc_asyncio', request assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_message_buses_async_from_dict(): - await test_list_message_buses_async(request_type=dict) - def test_list_message_buses_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -8445,8 +8465,10 @@ async def test_list_message_buses_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.ListMessageBusEnrollmentsRequest, - dict, + eventarc.ListMessageBusEnrollmentsRequest({ + }), + { + }, ]) def test_list_message_bus_enrollments(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -8456,7 +8478,7 @@ def test_list_message_bus_enrollments(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8579,7 +8601,11 @@ async def test_list_message_bus_enrollments_async_use_cached_wrapped_rpc(transpo assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_message_bus_enrollments_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListMessageBusEnrollmentsRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListMessageBusEnrollmentsRequest({ }), + { }, +]) +async def test_list_message_bus_enrollments_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8587,7 +8613,7 @@ async def test_list_message_bus_enrollments_async(transport: str = 'grpc_asyncio # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8613,11 +8639,6 @@ async def test_list_message_bus_enrollments_async(transport: str = 'grpc_asyncio assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_message_bus_enrollments_async_from_dict(): - await test_list_message_bus_enrollments_async(request_type=dict) - def test_list_message_bus_enrollments_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -8958,8 +8979,10 @@ async def test_list_message_bus_enrollments_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateMessageBusRequest, - dict, + eventarc.CreateMessageBusRequest({ + }), + { + }, ]) def test_create_message_bus(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -8969,7 +8992,7 @@ def test_create_message_bus(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9095,7 +9118,11 @@ async def test_create_message_bus_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_message_bus_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateMessageBusRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateMessageBusRequest({ }), + { }, +]) +async def test_create_message_bus_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9103,7 +9130,7 @@ async def test_create_message_bus_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9124,11 +9151,6 @@ async def test_create_message_bus_async(transport: str = 'grpc_asyncio', request # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_create_message_bus_async_from_dict(): - await test_create_message_bus_async(request_type=dict) - def test_create_message_bus_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -9297,8 +9319,10 @@ async def test_create_message_bus_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateMessageBusRequest, - dict, + eventarc.UpdateMessageBusRequest({ + }), + { + }, ]) def test_update_message_bus(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -9308,7 +9332,7 @@ def test_update_message_bus(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9430,7 +9454,11 @@ async def test_update_message_bus_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_message_bus_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateMessageBusRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateMessageBusRequest({ }), + { }, +]) +async def test_update_message_bus_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9438,7 +9466,7 @@ async def test_update_message_bus_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9459,11 +9487,6 @@ async def test_update_message_bus_async(transport: str = 'grpc_asyncio', request # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_update_message_bus_async_from_dict(): - await test_update_message_bus_async(request_type=dict) - def test_update_message_bus_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -9622,8 +9645,10 @@ async def test_update_message_bus_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteMessageBusRequest, - dict, + eventarc.DeleteMessageBusRequest({ + }), + { + }, ]) def test_delete_message_bus(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -9633,7 +9658,7 @@ def test_delete_message_bus(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9759,7 +9784,11 @@ async def test_delete_message_bus_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_message_bus_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteMessageBusRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteMessageBusRequest({ }), + { }, +]) +async def test_delete_message_bus_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9767,7 +9796,7 @@ async def test_delete_message_bus_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9788,11 +9817,6 @@ async def test_delete_message_bus_async(transport: str = 'grpc_asyncio', request # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_delete_message_bus_async_from_dict(): - await test_delete_message_bus_async(request_type=dict) - def test_delete_message_bus_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -9951,8 +9975,10 @@ async def test_delete_message_bus_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetEnrollmentRequest, - dict, + eventarc.GetEnrollmentRequest({ + }), + { + }, ]) def test_get_enrollment(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -9962,7 +9988,7 @@ def test_get_enrollment(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10091,7 +10117,11 @@ async def test_get_enrollment_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_enrollment_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetEnrollmentRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetEnrollmentRequest({ }), + { }, +]) +async def test_get_enrollment_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10099,7 +10129,7 @@ async def test_get_enrollment_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10133,11 +10163,6 @@ async def test_get_enrollment_async(transport: str = 'grpc_asyncio', request_typ assert response.message_bus == 'message_bus_value' assert response.destination == 'destination_value' - -@pytest.mark.asyncio -async def test_get_enrollment_async_from_dict(): - await test_get_enrollment_async(request_type=dict) - def test_get_enrollment_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -10284,8 +10309,10 @@ async def test_get_enrollment_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListEnrollmentsRequest, - dict, + eventarc.ListEnrollmentsRequest({ + }), + { + }, ]) def test_list_enrollments(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -10295,7 +10322,7 @@ def test_list_enrollments(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10420,7 +10447,11 @@ async def test_list_enrollments_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_enrollments_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListEnrollmentsRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListEnrollmentsRequest({ }), + { }, +]) +async def test_list_enrollments_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10428,7 +10459,7 @@ async def test_list_enrollments_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10452,11 +10483,6 @@ async def test_list_enrollments_async(transport: str = 'grpc_asyncio', request_t assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_enrollments_async_from_dict(): - await test_list_enrollments_async(request_type=dict) - def test_list_enrollments_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -10797,8 +10823,10 @@ async def test_list_enrollments_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateEnrollmentRequest, - dict, + eventarc.CreateEnrollmentRequest({ + }), + { + }, ]) def test_create_enrollment(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -10808,7 +10836,7 @@ def test_create_enrollment(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10934,7 +10962,11 @@ async def test_create_enrollment_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_enrollment_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateEnrollmentRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateEnrollmentRequest({ }), + { }, +]) +async def test_create_enrollment_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10942,7 +10974,7 @@ async def test_create_enrollment_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10963,11 +10995,6 @@ async def test_create_enrollment_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_create_enrollment_async_from_dict(): - await test_create_enrollment_async(request_type=dict) - def test_create_enrollment_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -11136,8 +11163,10 @@ async def test_create_enrollment_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateEnrollmentRequest, - dict, + eventarc.UpdateEnrollmentRequest({ + }), + { + }, ]) def test_update_enrollment(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -11147,7 +11176,7 @@ def test_update_enrollment(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11269,7 +11298,11 @@ async def test_update_enrollment_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_enrollment_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateEnrollmentRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateEnrollmentRequest({ }), + { }, +]) +async def test_update_enrollment_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -11277,7 +11310,7 @@ async def test_update_enrollment_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11298,11 +11331,6 @@ async def test_update_enrollment_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_update_enrollment_async_from_dict(): - await test_update_enrollment_async(request_type=dict) - def test_update_enrollment_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -11461,8 +11489,10 @@ async def test_update_enrollment_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteEnrollmentRequest, - dict, + eventarc.DeleteEnrollmentRequest({ + }), + { + }, ]) def test_delete_enrollment(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -11472,7 +11502,7 @@ def test_delete_enrollment(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11598,7 +11628,11 @@ async def test_delete_enrollment_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_enrollment_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteEnrollmentRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteEnrollmentRequest({ }), + { }, +]) +async def test_delete_enrollment_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -11606,7 +11640,7 @@ async def test_delete_enrollment_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11627,11 +11661,6 @@ async def test_delete_enrollment_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_delete_enrollment_async_from_dict(): - await test_delete_enrollment_async(request_type=dict) - def test_delete_enrollment_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -11790,8 +11819,10 @@ async def test_delete_enrollment_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetPipelineRequest, - dict, + eventarc.GetPipelineRequest({ + }), + { + }, ]) def test_get_pipeline(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -11801,7 +11832,7 @@ def test_get_pipeline(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11928,7 +11959,11 @@ async def test_get_pipeline_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_pipeline_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetPipelineRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetPipelineRequest({ }), + { }, +]) +async def test_get_pipeline_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -11936,7 +11971,7 @@ async def test_get_pipeline_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -11968,11 +12003,6 @@ async def test_get_pipeline_async(transport: str = 'grpc_asyncio', request_type= assert response.etag == 'etag_value' assert response.satisfies_pzs is True - -@pytest.mark.asyncio -async def test_get_pipeline_async_from_dict(): - await test_get_pipeline_async(request_type=dict) - def test_get_pipeline_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -12119,8 +12149,10 @@ async def test_get_pipeline_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListPipelinesRequest, - dict, + eventarc.ListPipelinesRequest({ + }), + { + }, ]) def test_list_pipelines(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -12130,7 +12162,7 @@ def test_list_pipelines(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -12255,7 +12287,11 @@ async def test_list_pipelines_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_pipelines_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListPipelinesRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListPipelinesRequest({ }), + { }, +]) +async def test_list_pipelines_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -12263,7 +12299,7 @@ async def test_list_pipelines_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -12287,11 +12323,6 @@ async def test_list_pipelines_async(transport: str = 'grpc_asyncio', request_typ assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_pipelines_async_from_dict(): - await test_list_pipelines_async(request_type=dict) - def test_list_pipelines_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -12632,8 +12663,10 @@ async def test_list_pipelines_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreatePipelineRequest, - dict, + eventarc.CreatePipelineRequest({ + }), + { + }, ]) def test_create_pipeline(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -12643,7 +12676,7 @@ def test_create_pipeline(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -12769,7 +12802,11 @@ async def test_create_pipeline_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_pipeline_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreatePipelineRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreatePipelineRequest({ }), + { }, +]) +async def test_create_pipeline_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -12777,7 +12814,7 @@ async def test_create_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -12798,11 +12835,6 @@ async def test_create_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_create_pipeline_async_from_dict(): - await test_create_pipeline_async(request_type=dict) - def test_create_pipeline_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -12971,8 +13003,10 @@ async def test_create_pipeline_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdatePipelineRequest, - dict, + eventarc.UpdatePipelineRequest({ + }), + { + }, ]) def test_update_pipeline(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -12982,7 +13016,7 @@ def test_update_pipeline(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13104,7 +13138,11 @@ async def test_update_pipeline_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_pipeline_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdatePipelineRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdatePipelineRequest({ }), + { }, +]) +async def test_update_pipeline_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -13112,7 +13150,7 @@ async def test_update_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13133,11 +13171,6 @@ async def test_update_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_update_pipeline_async_from_dict(): - await test_update_pipeline_async(request_type=dict) - def test_update_pipeline_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -13296,8 +13329,10 @@ async def test_update_pipeline_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeletePipelineRequest, - dict, + eventarc.DeletePipelineRequest({ + }), + { + }, ]) def test_delete_pipeline(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -13307,7 +13342,7 @@ def test_delete_pipeline(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13433,7 +13468,11 @@ async def test_delete_pipeline_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_pipeline_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeletePipelineRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeletePipelineRequest({ }), + { }, +]) +async def test_delete_pipeline_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -13441,7 +13480,7 @@ async def test_delete_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13462,11 +13501,6 @@ async def test_delete_pipeline_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_delete_pipeline_async_from_dict(): - await test_delete_pipeline_async(request_type=dict) - def test_delete_pipeline_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -13625,8 +13659,10 @@ async def test_delete_pipeline_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.GetGoogleApiSourceRequest, - dict, + eventarc.GetGoogleApiSourceRequest({ + }), + { + }, ]) def test_get_google_api_source(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -13636,7 +13672,7 @@ def test_get_google_api_source(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13763,7 +13799,11 @@ async def test_get_google_api_source_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_google_api_source_async(transport: str = 'grpc_asyncio', request_type=eventarc.GetGoogleApiSourceRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.GetGoogleApiSourceRequest({ }), + { }, +]) +async def test_get_google_api_source_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -13771,7 +13811,7 @@ async def test_get_google_api_source_async(transport: str = 'grpc_asyncio', requ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -13803,11 +13843,6 @@ async def test_get_google_api_source_async(transport: str = 'grpc_asyncio', requ assert response.destination == 'destination_value' assert response.crypto_key_name == 'crypto_key_name_value' - -@pytest.mark.asyncio -async def test_get_google_api_source_async_from_dict(): - await test_get_google_api_source_async(request_type=dict) - def test_get_google_api_source_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -13954,8 +13989,10 @@ async def test_get_google_api_source_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.ListGoogleApiSourcesRequest, - dict, + eventarc.ListGoogleApiSourcesRequest({ + }), + { + }, ]) def test_list_google_api_sources(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -13965,7 +14002,7 @@ def test_list_google_api_sources(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14090,7 +14127,11 @@ async def test_list_google_api_sources_async_use_cached_wrapped_rpc(transport: s assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_google_api_sources_async(transport: str = 'grpc_asyncio', request_type=eventarc.ListGoogleApiSourcesRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.ListGoogleApiSourcesRequest({ }), + { }, +]) +async def test_list_google_api_sources_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -14098,7 +14139,7 @@ async def test_list_google_api_sources_async(transport: str = 'grpc_asyncio', re # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14122,11 +14163,6 @@ async def test_list_google_api_sources_async(transport: str = 'grpc_asyncio', re assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_google_api_sources_async_from_dict(): - await test_list_google_api_sources_async(request_type=dict) - def test_list_google_api_sources_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -14467,8 +14503,10 @@ async def test_list_google_api_sources_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - eventarc.CreateGoogleApiSourceRequest, - dict, + eventarc.CreateGoogleApiSourceRequest({ + }), + { + }, ]) def test_create_google_api_source(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -14478,7 +14516,7 @@ def test_create_google_api_source(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14604,7 +14642,11 @@ async def test_create_google_api_source_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_google_api_source_async(transport: str = 'grpc_asyncio', request_type=eventarc.CreateGoogleApiSourceRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.CreateGoogleApiSourceRequest({ }), + { }, +]) +async def test_create_google_api_source_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -14612,7 +14654,7 @@ async def test_create_google_api_source_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14633,11 +14675,6 @@ async def test_create_google_api_source_async(transport: str = 'grpc_asyncio', r # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_create_google_api_source_async_from_dict(): - await test_create_google_api_source_async(request_type=dict) - def test_create_google_api_source_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -14806,8 +14843,10 @@ async def test_create_google_api_source_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.UpdateGoogleApiSourceRequest, - dict, + eventarc.UpdateGoogleApiSourceRequest({ + }), + { + }, ]) def test_update_google_api_source(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -14817,7 +14856,7 @@ def test_update_google_api_source(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14939,7 +14978,11 @@ async def test_update_google_api_source_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_google_api_source_async(transport: str = 'grpc_asyncio', request_type=eventarc.UpdateGoogleApiSourceRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.UpdateGoogleApiSourceRequest({ }), + { }, +]) +async def test_update_google_api_source_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -14947,7 +14990,7 @@ async def test_update_google_api_source_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -14968,11 +15011,6 @@ async def test_update_google_api_source_async(transport: str = 'grpc_asyncio', r # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_update_google_api_source_async_from_dict(): - await test_update_google_api_source_async(request_type=dict) - def test_update_google_api_source_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), @@ -15131,8 +15169,10 @@ async def test_update_google_api_source_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - eventarc.DeleteGoogleApiSourceRequest, - dict, + eventarc.DeleteGoogleApiSourceRequest({ + }), + { + }, ]) def test_delete_google_api_source(request_type, transport: str = 'grpc'): client = EventarcClient( @@ -15142,7 +15182,7 @@ def test_delete_google_api_source(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -15268,7 +15308,11 @@ async def test_delete_google_api_source_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_google_api_source_async(transport: str = 'grpc_asyncio', request_type=eventarc.DeleteGoogleApiSourceRequest): +@pytest.mark.parametrize("request_type", [ + eventarc.DeleteGoogleApiSourceRequest({ }), + { }, +]) +async def test_delete_google_api_source_async(request_type, transport: str = 'grpc_asyncio'): client = EventarcAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -15276,7 +15320,7 @@ async def test_delete_google_api_source_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -15297,11 +15341,6 @@ async def test_delete_google_api_source_async(transport: str = 'grpc_asyncio', r # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_delete_google_api_source_async_from_dict(): - await test_delete_google_api_source_async(request_type=dict) - def test_delete_google_api_source_field_headers(): client = EventarcClient( credentials=ga_credentials.AnonymousCredentials(), diff --git a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index ed083d5df952..82d06e87f1d2 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -944,8 +944,10 @@ def test_config_service_v2_client_create_channel_credentials_file(client_class, @pytest.mark.parametrize("request_type", [ - logging_config.ListBucketsRequest, - dict, + logging_config.ListBucketsRequest({ + }), + { + }, ]) def test_list_buckets(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -955,7 +957,7 @@ def test_list_buckets(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1074,7 +1076,11 @@ async def test_list_buckets_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListBucketsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListBucketsRequest({ }), + { }, +]) +async def test_list_buckets_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1082,7 +1088,7 @@ async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1104,11 +1110,6 @@ async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type= assert isinstance(response, pagers.ListBucketsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -1449,8 +1450,10 @@ async def test_list_buckets_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetBucketRequest, - dict, + logging_config.GetBucketRequest({ + }), + { + }, ]) def test_get_bucket(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -1460,7 +1463,7 @@ def test_get_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1589,7 +1592,11 @@ async def test_get_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetBucketRequest({ }), + { }, +]) +async def test_get_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1597,7 +1604,7 @@ async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1631,11 +1638,6 @@ async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=lo assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -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(), @@ -1700,8 +1702,10 @@ async def test_get_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateBucketRequest, - dict, + logging_config.CreateBucketRequest({ + }), + { + }, ]) def test_create_bucket_async(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -1711,7 +1715,7 @@ def test_create_bucket_async(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1837,7 +1841,11 @@ async def test_create_bucket_async_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateBucketRequest({ }), + { }, +]) +async def test_create_bucket_async_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1845,7 +1853,7 @@ async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', reques # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1866,11 +1874,6 @@ async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', reques # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -1935,8 +1938,10 @@ async def test_create_bucket_async_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateBucketRequest, - dict, + logging_config.UpdateBucketRequest({ + }), + { + }, ]) def test_update_bucket_async(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -1946,7 +1951,7 @@ def test_update_bucket_async(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2070,7 +2075,11 @@ async def test_update_bucket_async_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateBucketRequest({ }), + { }, +]) +async def test_update_bucket_async_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2078,7 +2087,7 @@ async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', reques # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2099,11 +2108,6 @@ async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', reques # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2168,8 +2172,10 @@ async def test_update_bucket_async_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateBucketRequest, - dict, + logging_config.CreateBucketRequest({ + }), + { + }, ]) def test_create_bucket(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -2179,7 +2185,7 @@ def test_create_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2310,7 +2316,11 @@ async def test_create_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateBucketRequest({ }), + { }, +]) +async def test_create_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2318,7 +2328,7 @@ async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2352,11 +2362,6 @@ async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -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(), @@ -2421,8 +2426,10 @@ async def test_create_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateBucketRequest, - dict, + logging_config.UpdateBucketRequest({ + }), + { + }, ]) def test_update_bucket(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -2432,7 +2439,7 @@ def test_update_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2561,7 +2568,11 @@ async def test_update_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateBucketRequest({ }), + { }, +]) +async def test_update_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2569,7 +2580,7 @@ async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2603,11 +2614,6 @@ async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -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(), @@ -2672,8 +2678,10 @@ async def test_update_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteBucketRequest, - dict, + logging_config.DeleteBucketRequest({ + }), + { + }, ]) def test_delete_bucket(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -2683,7 +2691,7 @@ def test_delete_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2797,7 +2805,11 @@ async def test_delete_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteBucketRequest({ }), + { }, +]) +async def test_delete_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2805,7 +2817,7 @@ async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2824,11 +2836,6 @@ async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -2893,8 +2900,10 @@ async def test_delete_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UndeleteBucketRequest, - dict, + logging_config.UndeleteBucketRequest({ + }), + { + }, ]) def test_undelete_bucket(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -2904,7 +2913,7 @@ def test_undelete_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3018,7 +3027,11 @@ async def test_undelete_bucket_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.UndeleteBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UndeleteBucketRequest({ }), + { }, +]) +async def test_undelete_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3026,7 +3039,7 @@ async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3045,11 +3058,6 @@ async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -3114,8 +3122,10 @@ async def test_undelete_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListViewsRequest, - dict, + logging_config.ListViewsRequest({ + }), + { + }, ]) def test_list_views(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -3125,7 +3135,7 @@ def test_list_views(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3244,7 +3254,11 @@ async def test_list_views_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_views_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListViewsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListViewsRequest({ }), + { }, +]) +async def test_list_views_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3252,7 +3266,7 @@ async def test_list_views_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3274,11 +3288,6 @@ async def test_list_views_async(transport: str = 'grpc_asyncio', request_type=lo assert isinstance(response, pagers.ListViewsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -3619,8 +3628,10 @@ async def test_list_views_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetViewRequest, - dict, + logging_config.GetViewRequest({ + }), + { + }, ]) def test_get_view(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -3630,7 +3641,7 @@ def test_get_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3751,7 +3762,11 @@ async def test_get_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetViewRequest({ }), + { }, +]) +async def test_get_view_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3759,7 +3774,7 @@ async def test_get_view_async(transport: str = 'grpc_asyncio', request_type=logg # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3785,11 +3800,6 @@ async def test_get_view_async(transport: str = 'grpc_asyncio', request_type=logg assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -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(), @@ -3854,8 +3864,10 @@ async def test_get_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateViewRequest, - dict, + logging_config.CreateViewRequest({ + }), + { + }, ]) def test_create_view(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -3865,7 +3877,7 @@ def test_create_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3988,7 +4000,11 @@ async def test_create_view_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateViewRequest({ }), + { }, +]) +async def test_create_view_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3996,7 +4012,7 @@ async def test_create_view_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4022,11 +4038,6 @@ async def test_create_view_async(transport: str = 'grpc_asyncio', request_type=l assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -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(), @@ -4091,8 +4102,10 @@ async def test_create_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateViewRequest, - dict, + logging_config.UpdateViewRequest({ + }), + { + }, ]) def test_update_view(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -4102,7 +4115,7 @@ def test_update_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4223,7 +4236,11 @@ async def test_update_view_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateViewRequest({ }), + { }, +]) +async def test_update_view_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4231,7 +4248,7 @@ async def test_update_view_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4257,11 +4274,6 @@ async def test_update_view_async(transport: str = 'grpc_asyncio', request_type=l assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -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(), @@ -4326,8 +4338,10 @@ async def test_update_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteViewRequest, - dict, + logging_config.DeleteViewRequest({ + }), + { + }, ]) def test_delete_view(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -4337,7 +4351,7 @@ def test_delete_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4451,7 +4465,11 @@ async def test_delete_view_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteViewRequest({ }), + { }, +]) +async def test_delete_view_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4459,7 +4477,7 @@ async def test_delete_view_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4478,11 +4496,6 @@ async def test_delete_view_async(transport: str = 'grpc_asyncio', request_type=l # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -4547,8 +4560,10 @@ async def test_delete_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListSinksRequest, - dict, + logging_config.ListSinksRequest({ + }), + { + }, ]) def test_list_sinks(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -4558,7 +4573,7 @@ def test_list_sinks(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4677,7 +4692,11 @@ async def test_list_sinks_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_sinks_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListSinksRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListSinksRequest({ }), + { }, +]) +async def test_list_sinks_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4685,7 +4704,7 @@ async def test_list_sinks_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4707,11 +4726,6 @@ async def test_list_sinks_async(transport: str = 'grpc_asyncio', request_type=lo assert isinstance(response, pagers.ListSinksAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -5052,8 +5066,10 @@ async def test_list_sinks_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetSinkRequest, - dict, + logging_config.GetSinkRequest({ + }), + { + }, ]) def test_get_sink(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -5063,7 +5079,7 @@ def test_get_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5194,7 +5210,11 @@ async def test_get_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetSinkRequest({ }), + { }, +]) +async def test_get_sink_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5202,7 +5222,7 @@ async def test_get_sink_async(transport: str = 'grpc_asyncio', request_type=logg # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5238,11 +5258,6 @@ async def test_get_sink_async(transport: str = 'grpc_asyncio', request_type=logg assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -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(), @@ -5389,8 +5404,10 @@ async def test_get_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateSinkRequest, - dict, + logging_config.CreateSinkRequest({ + }), + { + }, ]) def test_create_sink(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -5400,7 +5417,7 @@ def test_create_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5531,7 +5548,11 @@ async def test_create_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateSinkRequest({ }), + { }, +]) +async def test_create_sink_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5539,7 +5560,7 @@ async def test_create_sink_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5575,11 +5596,6 @@ async def test_create_sink_async(transport: str = 'grpc_asyncio', request_type=l assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -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(), @@ -5736,8 +5752,10 @@ async def test_create_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateSinkRequest, - dict, + logging_config.UpdateSinkRequest({ + }), + { + }, ]) def test_update_sink(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -5747,7 +5765,7 @@ def test_update_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5878,7 +5896,11 @@ async def test_update_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateSinkRequest({ }), + { }, +]) +async def test_update_sink_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5886,7 +5908,7 @@ async def test_update_sink_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5922,11 +5944,6 @@ async def test_update_sink_async(transport: str = 'grpc_asyncio', request_type=l assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -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(), @@ -6093,8 +6110,10 @@ async def test_update_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteSinkRequest, - dict, + logging_config.DeleteSinkRequest({ + }), + { + }, ]) def test_delete_sink(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -6104,7 +6123,7 @@ def test_delete_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6218,7 +6237,11 @@ async def test_delete_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteSinkRequest({ }), + { }, +]) +async def test_delete_sink_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6226,7 +6249,7 @@ async def test_delete_sink_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6245,11 +6268,6 @@ async def test_delete_sink_async(transport: str = 'grpc_asyncio', request_type=l # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -6396,8 +6414,10 @@ async def test_delete_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateLinkRequest, - dict, + logging_config.CreateLinkRequest({ + }), + { + }, ]) def test_create_link(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -6407,7 +6427,7 @@ def test_create_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6533,7 +6553,11 @@ async def test_create_link_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateLinkRequest({ }), + { }, +]) +async def test_create_link_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6541,7 +6565,7 @@ async def test_create_link_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6562,11 +6586,6 @@ async def test_create_link_async(transport: str = 'grpc_asyncio', request_type=l # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -6735,8 +6754,10 @@ async def test_create_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteLinkRequest, - dict, + logging_config.DeleteLinkRequest({ + }), + { + }, ]) def test_delete_link(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -6746,7 +6767,7 @@ def test_delete_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6870,7 +6891,11 @@ async def test_delete_link_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteLinkRequest({ }), + { }, +]) +async def test_delete_link_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6878,7 +6903,7 @@ async def test_delete_link_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6899,11 +6924,6 @@ async def test_delete_link_async(transport: str = 'grpc_asyncio', request_type=l # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -7052,8 +7072,10 @@ async def test_delete_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListLinksRequest, - dict, + logging_config.ListLinksRequest({ + }), + { + }, ]) def test_list_links(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -7063,7 +7085,7 @@ def test_list_links(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7182,7 +7204,11 @@ async def test_list_links_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_links_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListLinksRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListLinksRequest({ }), + { }, +]) +async def test_list_links_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7190,7 +7216,7 @@ async def test_list_links_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7212,11 +7238,6 @@ async def test_list_links_async(transport: str = 'grpc_asyncio', request_type=lo assert isinstance(response, pagers.ListLinksAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -7557,8 +7578,10 @@ async def test_list_links_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetLinkRequest, - dict, + logging_config.GetLinkRequest({ + }), + { + }, ]) def test_get_link(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -7568,7 +7591,7 @@ def test_get_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7689,7 +7712,11 @@ async def test_get_link_async_use_cached_wrapped_rpc(transport: str = "grpc_asyn assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetLinkRequest({ }), + { }, +]) +async def test_get_link_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7697,7 +7724,7 @@ async def test_get_link_async(transport: str = 'grpc_asyncio', request_type=logg # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7723,11 +7750,6 @@ async def test_get_link_async(transport: str = 'grpc_asyncio', request_type=logg assert response.description == 'description_value' assert response.lifecycle_state == logging_config.LifecycleState.ACTIVE - -@pytest.mark.asyncio -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(), @@ -7874,8 +7896,10 @@ async def test_get_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListExclusionsRequest, - dict, + logging_config.ListExclusionsRequest({ + }), + { + }, ]) def test_list_exclusions(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -7885,7 +7909,7 @@ def test_list_exclusions(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8004,7 +8028,11 @@ async def test_list_exclusions_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_exclusions_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListExclusionsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListExclusionsRequest({ }), + { }, +]) +async def test_list_exclusions_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8012,7 +8040,7 @@ async def test_list_exclusions_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8034,11 +8062,6 @@ async def test_list_exclusions_async(transport: str = 'grpc_asyncio', request_ty assert isinstance(response, pagers.ListExclusionsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -8379,8 +8402,10 @@ async def test_list_exclusions_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetExclusionRequest, - dict, + logging_config.GetExclusionRequest({ + }), + { + }, ]) def test_get_exclusion(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -8390,7 +8415,7 @@ def test_get_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8513,7 +8538,11 @@ async def test_get_exclusion_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetExclusionRequest({ }), + { }, +]) +async def test_get_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8521,7 +8550,7 @@ async def test_get_exclusion_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8549,11 +8578,6 @@ async def test_get_exclusion_async(transport: str = 'grpc_asyncio', request_type assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -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(), @@ -8700,8 +8724,10 @@ async def test_get_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateExclusionRequest, - dict, + logging_config.CreateExclusionRequest({ + }), + { + }, ]) def test_create_exclusion(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -8711,7 +8737,7 @@ def test_create_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8834,7 +8860,11 @@ async def test_create_exclusion_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateExclusionRequest({ }), + { }, +]) +async def test_create_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8842,7 +8872,7 @@ async def test_create_exclusion_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8870,11 +8900,6 @@ async def test_create_exclusion_async(transport: str = 'grpc_asyncio', request_t assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -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(), @@ -9031,8 +9056,10 @@ async def test_create_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateExclusionRequest, - dict, + logging_config.UpdateExclusionRequest({ + }), + { + }, ]) def test_update_exclusion(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -9042,7 +9069,7 @@ def test_update_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9165,7 +9192,11 @@ async def test_update_exclusion_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateExclusionRequest({ }), + { }, +]) +async def test_update_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9173,7 +9204,7 @@ async def test_update_exclusion_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9201,11 +9232,6 @@ async def test_update_exclusion_async(transport: str = 'grpc_asyncio', request_t assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -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(), @@ -9372,8 +9398,10 @@ async def test_update_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteExclusionRequest, - dict, + logging_config.DeleteExclusionRequest({ + }), + { + }, ]) def test_delete_exclusion(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -9383,7 +9411,7 @@ def test_delete_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9497,7 +9525,11 @@ async def test_delete_exclusion_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteExclusionRequest({ }), + { }, +]) +async def test_delete_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9505,7 +9537,7 @@ async def test_delete_exclusion_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9524,11 +9556,6 @@ async def test_delete_exclusion_async(transport: str = 'grpc_asyncio', request_t # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -9675,8 +9702,10 @@ async def test_delete_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.GetCmekSettingsRequest, - dict, + logging_config.GetCmekSettingsRequest({ + }), + { + }, ]) def test_get_cmek_settings(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -9686,7 +9715,7 @@ def test_get_cmek_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9809,7 +9838,11 @@ async def test_get_cmek_settings_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_cmek_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetCmekSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetCmekSettingsRequest({ }), + { }, +]) +async def test_get_cmek_settings_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9817,7 +9850,7 @@ async def test_get_cmek_settings_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9845,11 +9878,6 @@ async def test_get_cmek_settings_async(transport: str = 'grpc_asyncio', request_ assert response.kms_key_version_name == 'kms_key_version_name_value' assert response.service_account_id == 'service_account_id_value' - -@pytest.mark.asyncio -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(), @@ -9914,8 +9942,10 @@ async def test_get_cmek_settings_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateCmekSettingsRequest, - dict, + logging_config.UpdateCmekSettingsRequest({ + }), + { + }, ]) def test_update_cmek_settings(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -9925,7 +9955,7 @@ def test_update_cmek_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10048,7 +10078,11 @@ async def test_update_cmek_settings_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_cmek_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateCmekSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateCmekSettingsRequest({ }), + { }, +]) +async def test_update_cmek_settings_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10056,7 +10090,7 @@ async def test_update_cmek_settings_async(transport: str = 'grpc_asyncio', reque # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10084,11 +10118,6 @@ async def test_update_cmek_settings_async(transport: str = 'grpc_asyncio', reque assert response.kms_key_version_name == 'kms_key_version_name_value' assert response.service_account_id == 'service_account_id_value' - -@pytest.mark.asyncio -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(), @@ -10153,8 +10182,10 @@ async def test_update_cmek_settings_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.GetSettingsRequest, - dict, + logging_config.GetSettingsRequest({ + }), + { + }, ]) def test_get_settings(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -10164,7 +10195,7 @@ def test_get_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10289,7 +10320,11 @@ async def test_get_settings_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetSettingsRequest({ }), + { }, +]) +async def test_get_settings_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10297,7 +10332,7 @@ async def test_get_settings_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10327,11 +10362,6 @@ async def test_get_settings_async(transport: str = 'grpc_asyncio', request_type= assert response.storage_location == 'storage_location_value' assert response.disable_default_sink is True - -@pytest.mark.asyncio -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(), @@ -10478,8 +10508,10 @@ async def test_get_settings_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateSettingsRequest, - dict, + logging_config.UpdateSettingsRequest({ + }), + { + }, ]) def test_update_settings(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -10489,7 +10521,7 @@ def test_update_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10614,7 +10646,11 @@ async def test_update_settings_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateSettingsRequest({ }), + { }, +]) +async def test_update_settings_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10622,7 +10658,7 @@ async def test_update_settings_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10652,11 +10688,6 @@ async def test_update_settings_async(transport: str = 'grpc_asyncio', request_ty assert response.storage_location == 'storage_location_value' assert response.disable_default_sink is True - -@pytest.mark.asyncio -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(), @@ -10813,8 +10844,10 @@ async def test_update_settings_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CopyLogEntriesRequest, - dict, + logging_config.CopyLogEntriesRequest({ + }), + { + }, ]) def test_copy_log_entries(request_type, transport: str = 'grpc'): client = ConfigServiceV2Client( @@ -10824,7 +10857,7 @@ def test_copy_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10952,7 +10985,11 @@ async def test_copy_log_entries_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_copy_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging_config.CopyLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CopyLogEntriesRequest({ }), + { }, +]) +async def test_copy_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = ConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10960,7 +10997,7 @@ async def test_copy_log_entries_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10982,11 +11019,6 @@ async def test_copy_log_entries_async(transport: str = 'grpc_asyncio', request_t assert isinstance(response, future.Future) -@pytest.mark.asyncio -async def test_copy_log_entries_async_from_dict(): - await test_copy_log_entries_async(request_type=dict) - - def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ConfigServiceV2GrpcTransport( diff --git a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index d7afda5d42ba..39a217dd73de 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -946,8 +946,10 @@ def test_logging_service_v2_client_create_channel_credentials_file(client_class, @pytest.mark.parametrize("request_type", [ - logging.DeleteLogRequest, - dict, + logging.DeleteLogRequest({ + }), + { + }, ]) def test_delete_log(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -957,7 +959,7 @@ def test_delete_log(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1071,7 +1073,11 @@ async def test_delete_log_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=logging.DeleteLogRequest): +@pytest.mark.parametrize("request_type", [ + logging.DeleteLogRequest({ }), + { }, +]) +async def test_delete_log_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1079,7 +1085,7 @@ async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1098,11 +1104,6 @@ async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=lo # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -1249,8 +1250,10 @@ async def test_delete_log_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging.WriteLogEntriesRequest, - dict, + logging.WriteLogEntriesRequest({ + }), + { + }, ]) def test_write_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1260,7 +1263,7 @@ def test_write_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1375,7 +1378,11 @@ async def test_write_log_entries_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.WriteLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.WriteLogEntriesRequest({ }), + { }, +]) +async def test_write_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1383,7 +1390,7 @@ async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1404,11 +1411,6 @@ async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_ assert isinstance(response, logging.WriteLogEntriesResponse) -@pytest.mark.asyncio -async def test_write_log_entries_async_from_dict(): - await test_write_log_entries_async(request_type=dict) - - def test_write_log_entries_flattened(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1522,8 +1524,10 @@ async def test_write_log_entries_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging.ListLogEntriesRequest, - dict, + logging.ListLogEntriesRequest({ + }), + { + }, ]) def test_list_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1533,7 +1537,7 @@ def test_list_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1654,7 +1658,11 @@ async def test_list_log_entries_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.ListLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListLogEntriesRequest({ }), + { }, +]) +async def test_list_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1662,7 +1670,7 @@ async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1685,11 +1693,6 @@ async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_t assert response.next_page_token == 'next_page_token_value' -@pytest.mark.asyncio -async def test_list_log_entries_async_from_dict(): - await test_list_log_entries_async(request_type=dict) - - def test_list_log_entries_flattened(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1982,8 +1985,10 @@ async def test_list_log_entries_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.ListMonitoredResourceDescriptorsRequest, - dict, + logging.ListMonitoredResourceDescriptorsRequest({ + }), + { + }, ]) def test_list_monitored_resource_descriptors(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1993,7 +1998,7 @@ def test_list_monitored_resource_descriptors(request_type, transport: str = 'grp # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2110,7 +2115,11 @@ async def test_list_monitored_resource_descriptors_async_use_cached_wrapped_rpc( assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_asyncio', request_type=logging.ListMonitoredResourceDescriptorsRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListMonitoredResourceDescriptorsRequest({ }), + { }, +]) +async def test_list_monitored_resource_descriptors_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2118,7 +2127,7 @@ async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2141,11 +2150,6 @@ async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_ assert response.next_page_token == 'next_page_token_value' -@pytest.mark.asyncio -async def test_list_monitored_resource_descriptors_async_from_dict(): - await test_list_monitored_resource_descriptors_async(request_type=dict) - - def test_list_monitored_resource_descriptors_pager(transport_name: str = "grpc"): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2336,8 +2340,10 @@ async def test_list_monitored_resource_descriptors_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.ListLogsRequest, - dict, + logging.ListLogsRequest({ + }), + { + }, ]) def test_list_logs(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -2347,7 +2353,7 @@ def test_list_logs(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2468,7 +2474,11 @@ async def test_list_logs_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=logging.ListLogsRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListLogsRequest({ }), + { }, +]) +async def test_list_logs_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2476,7 +2486,7 @@ async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=log # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2500,11 +2510,6 @@ async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=log assert response.log_names == ['log_names_value'] assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -2845,8 +2850,10 @@ async def test_list_logs_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.TailLogEntriesRequest, - dict, + logging.TailLogEntriesRequest({ + }), + { + }, ]) def test_tail_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -2856,7 +2863,7 @@ def test_tail_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type requests = [request] # Mock the actual call within the gRPC stub, and fake the request. @@ -2876,7 +2883,6 @@ def test_tail_log_entries(request_type, transport: str = 'grpc'): for message in response: assert isinstance(message, logging.TailLogEntriesResponse) - def test_tail_log_entries_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -2944,7 +2950,11 @@ async def test_tail_log_entries_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.TailLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.TailLogEntriesRequest({ }), + { }, +]) +async def test_tail_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2952,7 +2962,7 @@ async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type requests = [request] # Mock the actual call within the gRPC stub, and fake the request. @@ -2974,11 +2984,6 @@ async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_t assert isinstance(message, logging.TailLogEntriesResponse) -@pytest.mark.asyncio -async def test_tail_log_entries_async_from_dict(): - await test_tail_log_entries_async(request_type=dict) - - def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LoggingServiceV2GrpcTransport( diff --git a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index f5ff8608ef45..c66be91364a7 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -944,8 +944,10 @@ def test_metrics_service_v2_client_create_channel_credentials_file(client_class, @pytest.mark.parametrize("request_type", [ - logging_metrics.ListLogMetricsRequest, - dict, + logging_metrics.ListLogMetricsRequest({ + }), + { + }, ]) def test_list_log_metrics(request_type, transport: str = 'grpc'): client = MetricsServiceV2Client( @@ -955,7 +957,7 @@ def test_list_log_metrics(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1074,7 +1076,11 @@ async def test_list_log_metrics_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_log_metrics_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.ListLogMetricsRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.ListLogMetricsRequest({ }), + { }, +]) +async def test_list_log_metrics_async(request_type, transport: str = 'grpc_asyncio'): client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1082,7 +1088,7 @@ async def test_list_log_metrics_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1104,11 +1110,6 @@ async def test_list_log_metrics_async(transport: str = 'grpc_asyncio', request_t assert isinstance(response, pagers.ListLogMetricsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -1449,8 +1450,10 @@ async def test_list_log_metrics_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_metrics.GetLogMetricRequest, - dict, + logging_metrics.GetLogMetricRequest({ + }), + { + }, ]) def test_get_log_metric(request_type, transport: str = 'grpc'): client = MetricsServiceV2Client( @@ -1460,7 +1463,7 @@ def test_get_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1589,7 +1592,11 @@ async def test_get_log_metric_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.GetLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.GetLogMetricRequest({ }), + { }, +]) +async def test_get_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1597,7 +1604,7 @@ async def test_get_log_metric_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1631,11 +1638,6 @@ async def test_get_log_metric_async(transport: str = 'grpc_asyncio', request_typ assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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(), @@ -1782,8 +1784,10 @@ async def test_get_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.CreateLogMetricRequest, - dict, + logging_metrics.CreateLogMetricRequest({ + }), + { + }, ]) def test_create_log_metric(request_type, transport: str = 'grpc'): client = MetricsServiceV2Client( @@ -1793,7 +1797,7 @@ def test_create_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1922,7 +1926,11 @@ async def test_create_log_metric_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.CreateLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.CreateLogMetricRequest({ }), + { }, +]) +async def test_create_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1930,7 +1938,7 @@ async def test_create_log_metric_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1964,11 +1972,6 @@ async def test_create_log_metric_async(transport: str = 'grpc_asyncio', request_ assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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(), @@ -2125,8 +2128,10 @@ async def test_create_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.UpdateLogMetricRequest, - dict, + logging_metrics.UpdateLogMetricRequest({ + }), + { + }, ]) def test_update_log_metric(request_type, transport: str = 'grpc'): client = MetricsServiceV2Client( @@ -2136,7 +2141,7 @@ def test_update_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2265,7 +2270,11 @@ async def test_update_log_metric_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.UpdateLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.UpdateLogMetricRequest({ }), + { }, +]) +async def test_update_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2273,7 +2282,7 @@ async def test_update_log_metric_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2307,11 +2316,6 @@ async def test_update_log_metric_async(transport: str = 'grpc_asyncio', request_ assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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(), @@ -2468,8 +2472,10 @@ async def test_update_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.DeleteLogMetricRequest, - dict, + logging_metrics.DeleteLogMetricRequest({ + }), + { + }, ]) def test_delete_log_metric(request_type, transport: str = 'grpc'): client = MetricsServiceV2Client( @@ -2479,7 +2485,7 @@ def test_delete_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2593,7 +2599,11 @@ async def test_delete_log_metric_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.DeleteLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.DeleteLogMetricRequest({ }), + { }, +]) +async def test_delete_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = MetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2601,7 +2611,7 @@ async def test_delete_log_metric_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2620,11 +2630,6 @@ async def test_delete_log_metric_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), diff --git a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_config_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_config_service_v2.py index e65cb64a539c..36385343e2f7 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -944,8 +944,10 @@ def test_base_config_service_v2_client_create_channel_credentials_file(client_cl @pytest.mark.parametrize("request_type", [ - logging_config.ListBucketsRequest, - dict, + logging_config.ListBucketsRequest({ + }), + { + }, ]) def test_list_buckets(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -955,7 +957,7 @@ def test_list_buckets(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1074,7 +1076,11 @@ async def test_list_buckets_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListBucketsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListBucketsRequest({ }), + { }, +]) +async def test_list_buckets_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1082,7 +1088,7 @@ async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1104,11 +1110,6 @@ async def test_list_buckets_async(transport: str = 'grpc_asyncio', request_type= assert isinstance(response, pagers.ListBucketsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -async def test_list_buckets_async_from_dict(): - await test_list_buckets_async(request_type=dict) - def test_list_buckets_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1449,8 +1450,10 @@ async def test_list_buckets_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetBucketRequest, - dict, + logging_config.GetBucketRequest({ + }), + { + }, ]) def test_get_bucket(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -1460,7 +1463,7 @@ def test_get_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1589,7 +1592,11 @@ async def test_get_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetBucketRequest({ }), + { }, +]) +async def test_get_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1597,7 +1604,7 @@ async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1631,11 +1638,6 @@ async def test_get_bucket_async(transport: str = 'grpc_asyncio', request_type=lo assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -async def test_get_bucket_async_from_dict(): - await test_get_bucket_async(request_type=dict) - def test_get_bucket_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1700,8 +1702,10 @@ async def test_get_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateBucketRequest, - dict, + logging_config.CreateBucketRequest({ + }), + { + }, ]) def test_create_bucket_async(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -1711,7 +1715,7 @@ def test_create_bucket_async(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1837,7 +1841,11 @@ async def test_create_bucket_async_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateBucketRequest({ }), + { }, +]) +async def test_create_bucket_async_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1845,7 +1853,7 @@ async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', reques # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1866,11 +1874,6 @@ async def test_create_bucket_async_async(transport: str = 'grpc_asyncio', reques # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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 = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1935,8 +1938,10 @@ async def test_create_bucket_async_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateBucketRequest, - dict, + logging_config.UpdateBucketRequest({ + }), + { + }, ]) def test_update_bucket_async(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -1946,7 +1951,7 @@ def test_update_bucket_async(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2070,7 +2075,11 @@ async def test_update_bucket_async_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateBucketRequest({ }), + { }, +]) +async def test_update_bucket_async_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2078,7 +2087,7 @@ async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', reques # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2099,11 +2108,6 @@ async def test_update_bucket_async_async(transport: str = 'grpc_asyncio', reques # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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 = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2168,8 +2172,10 @@ async def test_update_bucket_async_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateBucketRequest, - dict, + logging_config.CreateBucketRequest({ + }), + { + }, ]) def test_create_bucket(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -2179,7 +2185,7 @@ def test_create_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2310,7 +2316,11 @@ async def test_create_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateBucketRequest({ }), + { }, +]) +async def test_create_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2318,7 +2328,7 @@ async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2352,11 +2362,6 @@ async def test_create_bucket_async(transport: str = 'grpc_asyncio', request_type assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -async def test_create_bucket_async_from_dict(): - await test_create_bucket_async(request_type=dict) - def test_create_bucket_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2421,8 +2426,10 @@ async def test_create_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateBucketRequest, - dict, + logging_config.UpdateBucketRequest({ + }), + { + }, ]) def test_update_bucket(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -2432,7 +2439,7 @@ def test_update_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2561,7 +2568,11 @@ async def test_update_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateBucketRequest({ }), + { }, +]) +async def test_update_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2569,7 +2580,7 @@ async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2603,11 +2614,6 @@ async def test_update_bucket_async(transport: str = 'grpc_asyncio', request_type assert response.analytics_enabled is True assert response.restricted_fields == ['restricted_fields_value'] - -@pytest.mark.asyncio -async def test_update_bucket_async_from_dict(): - await test_update_bucket_async(request_type=dict) - def test_update_bucket_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2672,8 +2678,10 @@ async def test_update_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteBucketRequest, - dict, + logging_config.DeleteBucketRequest({ + }), + { + }, ]) def test_delete_bucket(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -2683,7 +2691,7 @@ def test_delete_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2797,7 +2805,11 @@ async def test_delete_bucket_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteBucketRequest({ }), + { }, +]) +async def test_delete_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2805,7 +2817,7 @@ async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2824,11 +2836,6 @@ async def test_delete_bucket_async(transport: str = 'grpc_asyncio', request_type # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test_delete_bucket_async_from_dict(): - await test_delete_bucket_async(request_type=dict) - def test_delete_bucket_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2893,8 +2900,10 @@ async def test_delete_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UndeleteBucketRequest, - dict, + logging_config.UndeleteBucketRequest({ + }), + { + }, ]) def test_undelete_bucket(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -2904,7 +2913,7 @@ def test_undelete_bucket(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3018,7 +3027,11 @@ async def test_undelete_bucket_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_type=logging_config.UndeleteBucketRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UndeleteBucketRequest({ }), + { }, +]) +async def test_undelete_bucket_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3026,7 +3039,7 @@ async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3045,11 +3058,6 @@ async def test_undelete_bucket_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test_undelete_bucket_async_from_dict(): - await test_undelete_bucket_async(request_type=dict) - def test_undelete_bucket_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3114,8 +3122,10 @@ async def test_undelete_bucket_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListViewsRequest, - dict, + logging_config.ListViewsRequest({ + }), + { + }, ]) def test__list_views(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -3125,7 +3135,7 @@ def test__list_views(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3244,7 +3254,11 @@ async def test__list_views_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__list_views_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListViewsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListViewsRequest({ }), + { }, +]) +async def test__list_views_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3252,7 +3266,7 @@ async def test__list_views_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3274,11 +3288,6 @@ async def test__list_views_async(transport: str = 'grpc_asyncio', request_type=l assert isinstance(response, pagers.ListViewsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -async def test__list_views_async_from_dict(): - await test__list_views_async(request_type=dict) - def test__list_views_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3619,8 +3628,10 @@ async def test__list_views_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetViewRequest, - dict, + logging_config.GetViewRequest({ + }), + { + }, ]) def test__get_view(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -3630,7 +3641,7 @@ def test__get_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3751,7 +3762,11 @@ async def test__get_view_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetViewRequest({ }), + { }, +]) +async def test__get_view_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3759,7 +3774,7 @@ async def test__get_view_async(transport: str = 'grpc_asyncio', request_type=log # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3785,11 +3800,6 @@ async def test__get_view_async(transport: str = 'grpc_asyncio', request_type=log assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -async def test__get_view_async_from_dict(): - await test__get_view_async(request_type=dict) - def test__get_view_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -3854,8 +3864,10 @@ async def test__get_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateViewRequest, - dict, + logging_config.CreateViewRequest({ + }), + { + }, ]) def test__create_view(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -3865,7 +3877,7 @@ def test__create_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3988,7 +4000,11 @@ async def test__create_view_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__create_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateViewRequest({ }), + { }, +]) +async def test__create_view_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3996,7 +4012,7 @@ async def test__create_view_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4022,11 +4038,6 @@ async def test__create_view_async(transport: str = 'grpc_asyncio', request_type= assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -async def test__create_view_async_from_dict(): - await test__create_view_async(request_type=dict) - def test__create_view_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4091,8 +4102,10 @@ async def test__create_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateViewRequest, - dict, + logging_config.UpdateViewRequest({ + }), + { + }, ]) def test__update_view(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -4102,7 +4115,7 @@ def test__update_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4223,7 +4236,11 @@ async def test__update_view_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateViewRequest({ }), + { }, +]) +async def test__update_view_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4231,7 +4248,7 @@ async def test__update_view_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4257,11 +4274,6 @@ async def test__update_view_async(transport: str = 'grpc_asyncio', request_type= assert response.description == 'description_value' assert response.filter == 'filter_value' - -@pytest.mark.asyncio -async def test__update_view_async_from_dict(): - await test__update_view_async(request_type=dict) - def test__update_view_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4326,8 +4338,10 @@ async def test__update_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteViewRequest, - dict, + logging_config.DeleteViewRequest({ + }), + { + }, ]) def test__delete_view(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -4337,7 +4351,7 @@ def test__delete_view(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4451,7 +4465,11 @@ async def test__delete_view_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__delete_view_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteViewRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteViewRequest({ }), + { }, +]) +async def test__delete_view_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4459,7 +4477,7 @@ async def test__delete_view_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4478,11 +4496,6 @@ async def test__delete_view_async(transport: str = 'grpc_asyncio', request_type= # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test__delete_view_async_from_dict(): - await test__delete_view_async(request_type=dict) - def test__delete_view_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -4547,8 +4560,10 @@ async def test__delete_view_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListSinksRequest, - dict, + logging_config.ListSinksRequest({ + }), + { + }, ]) def test__list_sinks(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -4558,7 +4573,7 @@ def test__list_sinks(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4677,7 +4692,11 @@ async def test__list_sinks_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__list_sinks_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListSinksRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListSinksRequest({ }), + { }, +]) +async def test__list_sinks_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4685,7 +4704,7 @@ async def test__list_sinks_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4707,11 +4726,6 @@ async def test__list_sinks_async(transport: str = 'grpc_asyncio', request_type=l assert isinstance(response, pagers.ListSinksAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -async def test__list_sinks_async_from_dict(): - await test__list_sinks_async(request_type=dict) - def test__list_sinks_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5052,8 +5066,10 @@ async def test__list_sinks_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetSinkRequest, - dict, + logging_config.GetSinkRequest({ + }), + { + }, ]) def test__get_sink(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -5063,7 +5079,7 @@ def test__get_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5194,7 +5210,11 @@ async def test__get_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetSinkRequest({ }), + { }, +]) +async def test__get_sink_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5202,7 +5222,7 @@ async def test__get_sink_async(transport: str = 'grpc_asyncio', request_type=log # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5238,11 +5258,6 @@ async def test__get_sink_async(transport: str = 'grpc_asyncio', request_type=log assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -async def test__get_sink_async_from_dict(): - await test__get_sink_async(request_type=dict) - def test__get_sink_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5389,8 +5404,10 @@ async def test__get_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateSinkRequest, - dict, + logging_config.CreateSinkRequest({ + }), + { + }, ]) def test__create_sink(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -5400,7 +5417,7 @@ def test__create_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5531,7 +5548,11 @@ async def test__create_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__create_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateSinkRequest({ }), + { }, +]) +async def test__create_sink_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5539,7 +5560,7 @@ async def test__create_sink_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5575,11 +5596,6 @@ async def test__create_sink_async(transport: str = 'grpc_asyncio', request_type= assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -async def test__create_sink_async_from_dict(): - await test__create_sink_async(request_type=dict) - def test__create_sink_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -5736,8 +5752,10 @@ async def test__create_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateSinkRequest, - dict, + logging_config.UpdateSinkRequest({ + }), + { + }, ]) def test__update_sink(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -5747,7 +5765,7 @@ def test__update_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5878,7 +5896,11 @@ async def test__update_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateSinkRequest({ }), + { }, +]) +async def test__update_sink_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -5886,7 +5908,7 @@ async def test__update_sink_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5922,11 +5944,6 @@ async def test__update_sink_async(transport: str = 'grpc_asyncio', request_type= assert response.writer_identity == 'writer_identity_value' assert response.include_children is True - -@pytest.mark.asyncio -async def test__update_sink_async_from_dict(): - await test__update_sink_async(request_type=dict) - def test__update_sink_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6093,8 +6110,10 @@ async def test__update_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteSinkRequest, - dict, + logging_config.DeleteSinkRequest({ + }), + { + }, ]) def test__delete_sink(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -6104,7 +6123,7 @@ def test__delete_sink(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6218,7 +6237,11 @@ async def test__delete_sink_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__delete_sink_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteSinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteSinkRequest({ }), + { }, +]) +async def test__delete_sink_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6226,7 +6249,7 @@ async def test__delete_sink_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6245,11 +6268,6 @@ async def test__delete_sink_async(transport: str = 'grpc_asyncio', request_type= # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test__delete_sink_async_from_dict(): - await test__delete_sink_async(request_type=dict) - def test__delete_sink_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6396,8 +6414,10 @@ async def test__delete_sink_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateLinkRequest, - dict, + logging_config.CreateLinkRequest({ + }), + { + }, ]) def test__create_link(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -6407,7 +6427,7 @@ def test__create_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6533,7 +6553,11 @@ async def test__create_link_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__create_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateLinkRequest({ }), + { }, +]) +async def test__create_link_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6541,7 +6565,7 @@ async def test__create_link_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6562,11 +6586,6 @@ async def test__create_link_async(transport: str = 'grpc_asyncio', request_type= # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test__create_link_async_from_dict(): - await test__create_link_async(request_type=dict) - def test__create_link_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -6735,8 +6754,10 @@ async def test__create_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteLinkRequest, - dict, + logging_config.DeleteLinkRequest({ + }), + { + }, ]) def test__delete_link(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -6746,7 +6767,7 @@ def test__delete_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6870,7 +6891,11 @@ async def test__delete_link_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__delete_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteLinkRequest({ }), + { }, +]) +async def test__delete_link_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -6878,7 +6903,7 @@ async def test__delete_link_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6899,11 +6924,6 @@ async def test__delete_link_async(transport: str = 'grpc_asyncio', request_type= # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test__delete_link_async_from_dict(): - await test__delete_link_async(request_type=dict) - def test__delete_link_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7052,8 +7072,10 @@ async def test__delete_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListLinksRequest, - dict, + logging_config.ListLinksRequest({ + }), + { + }, ]) def test__list_links(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -7063,7 +7085,7 @@ def test__list_links(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7182,7 +7204,11 @@ async def test__list_links_async_use_cached_wrapped_rpc(transport: str = "grpc_a assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__list_links_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListLinksRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListLinksRequest({ }), + { }, +]) +async def test__list_links_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7190,7 +7216,7 @@ async def test__list_links_async(transport: str = 'grpc_asyncio', request_type=l # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7212,11 +7238,6 @@ async def test__list_links_async(transport: str = 'grpc_asyncio', request_type=l assert isinstance(response, pagers.ListLinksAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -async def test__list_links_async_from_dict(): - await test__list_links_async(request_type=dict) - def test__list_links_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7557,8 +7578,10 @@ async def test__list_links_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetLinkRequest, - dict, + logging_config.GetLinkRequest({ + }), + { + }, ]) def test__get_link(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -7568,7 +7591,7 @@ def test__get_link(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7689,7 +7712,11 @@ async def test__get_link_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_link_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetLinkRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetLinkRequest({ }), + { }, +]) +async def test__get_link_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -7697,7 +7724,7 @@ async def test__get_link_async(transport: str = 'grpc_asyncio', request_type=log # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7723,11 +7750,6 @@ async def test__get_link_async(transport: str = 'grpc_asyncio', request_type=log assert response.description == 'description_value' assert response.lifecycle_state == logging_config.LifecycleState.ACTIVE - -@pytest.mark.asyncio -async def test__get_link_async_from_dict(): - await test__get_link_async(request_type=dict) - def test__get_link_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -7874,8 +7896,10 @@ async def test__get_link_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.ListExclusionsRequest, - dict, + logging_config.ListExclusionsRequest({ + }), + { + }, ]) def test__list_exclusions(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -7885,7 +7909,7 @@ def test__list_exclusions(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8004,7 +8028,11 @@ async def test__list_exclusions_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__list_exclusions_async(transport: str = 'grpc_asyncio', request_type=logging_config.ListExclusionsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.ListExclusionsRequest({ }), + { }, +]) +async def test__list_exclusions_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8012,7 +8040,7 @@ async def test__list_exclusions_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8034,11 +8062,6 @@ async def test__list_exclusions_async(transport: str = 'grpc_asyncio', request_t assert isinstance(response, pagers.ListExclusionsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -async def test__list_exclusions_async_from_dict(): - await test__list_exclusions_async(request_type=dict) - def test__list_exclusions_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -8379,8 +8402,10 @@ async def test__list_exclusions_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_config.GetExclusionRequest, - dict, + logging_config.GetExclusionRequest({ + }), + { + }, ]) def test__get_exclusion(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -8390,7 +8415,7 @@ def test__get_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8513,7 +8538,11 @@ async def test__get_exclusion_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetExclusionRequest({ }), + { }, +]) +async def test__get_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8521,7 +8550,7 @@ async def test__get_exclusion_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8549,11 +8578,6 @@ async def test__get_exclusion_async(transport: str = 'grpc_asyncio', request_typ assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -async def test__get_exclusion_async_from_dict(): - await test__get_exclusion_async(request_type=dict) - def test__get_exclusion_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -8700,8 +8724,10 @@ async def test__get_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CreateExclusionRequest, - dict, + logging_config.CreateExclusionRequest({ + }), + { + }, ]) def test__create_exclusion(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -8711,7 +8737,7 @@ def test__create_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8834,7 +8860,11 @@ async def test__create_exclusion_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__create_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.CreateExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CreateExclusionRequest({ }), + { }, +]) +async def test__create_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -8842,7 +8872,7 @@ async def test__create_exclusion_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8870,11 +8900,6 @@ async def test__create_exclusion_async(transport: str = 'grpc_asyncio', request_ assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -async def test__create_exclusion_async_from_dict(): - await test__create_exclusion_async(request_type=dict) - def test__create_exclusion_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9031,8 +9056,10 @@ async def test__create_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateExclusionRequest, - dict, + logging_config.UpdateExclusionRequest({ + }), + { + }, ]) def test__update_exclusion(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -9042,7 +9069,7 @@ def test__update_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9165,7 +9192,11 @@ async def test__update_exclusion_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateExclusionRequest({ }), + { }, +]) +async def test__update_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9173,7 +9204,7 @@ async def test__update_exclusion_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9201,11 +9232,6 @@ async def test__update_exclusion_async(transport: str = 'grpc_asyncio', request_ assert response.filter == 'filter_value' assert response.disabled is True - -@pytest.mark.asyncio -async def test__update_exclusion_async_from_dict(): - await test__update_exclusion_async(request_type=dict) - def test__update_exclusion_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9372,8 +9398,10 @@ async def test__update_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.DeleteExclusionRequest, - dict, + logging_config.DeleteExclusionRequest({ + }), + { + }, ]) def test__delete_exclusion(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -9383,7 +9411,7 @@ def test__delete_exclusion(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9497,7 +9525,11 @@ async def test__delete_exclusion_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__delete_exclusion_async(transport: str = 'grpc_asyncio', request_type=logging_config.DeleteExclusionRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.DeleteExclusionRequest({ }), + { }, +]) +async def test__delete_exclusion_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9505,7 +9537,7 @@ async def test__delete_exclusion_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9524,11 +9556,6 @@ async def test__delete_exclusion_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test__delete_exclusion_async_from_dict(): - await test__delete_exclusion_async(request_type=dict) - def test__delete_exclusion_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9675,8 +9702,10 @@ async def test__delete_exclusion_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.GetCmekSettingsRequest, - dict, + logging_config.GetCmekSettingsRequest({ + }), + { + }, ]) def test__get_cmek_settings(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -9686,7 +9715,7 @@ def test__get_cmek_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9809,7 +9838,11 @@ async def test__get_cmek_settings_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_cmek_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetCmekSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetCmekSettingsRequest({ }), + { }, +]) +async def test__get_cmek_settings_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -9817,7 +9850,7 @@ async def test__get_cmek_settings_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9845,11 +9878,6 @@ async def test__get_cmek_settings_async(transport: str = 'grpc_asyncio', request assert response.kms_key_version_name == 'kms_key_version_name_value' assert response.service_account_id == 'service_account_id_value' - -@pytest.mark.asyncio -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 = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -9914,8 +9942,10 @@ async def test__get_cmek_settings_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateCmekSettingsRequest, - dict, + logging_config.UpdateCmekSettingsRequest({ + }), + { + }, ]) def test__update_cmek_settings(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -9925,7 +9955,7 @@ def test__update_cmek_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10048,7 +10078,11 @@ async def test__update_cmek_settings_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_cmek_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateCmekSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateCmekSettingsRequest({ }), + { }, +]) +async def test__update_cmek_settings_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10056,7 +10090,7 @@ async def test__update_cmek_settings_async(transport: str = 'grpc_asyncio', requ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10084,11 +10118,6 @@ async def test__update_cmek_settings_async(transport: str = 'grpc_asyncio', requ assert response.kms_key_version_name == 'kms_key_version_name_value' assert response.service_account_id == 'service_account_id_value' - -@pytest.mark.asyncio -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 = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10153,8 +10182,10 @@ async def test__update_cmek_settings_field_headers_async(): @pytest.mark.parametrize("request_type", [ - logging_config.GetSettingsRequest, - dict, + logging_config.GetSettingsRequest({ + }), + { + }, ]) def test__get_settings(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -10164,7 +10195,7 @@ def test__get_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10289,7 +10320,11 @@ async def test__get_settings_async_use_cached_wrapped_rpc(transport: str = "grpc assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.GetSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.GetSettingsRequest({ }), + { }, +]) +async def test__get_settings_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10297,7 +10332,7 @@ async def test__get_settings_async(transport: str = 'grpc_asyncio', request_type # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10327,11 +10362,6 @@ async def test__get_settings_async(transport: str = 'grpc_asyncio', request_type assert response.storage_location == 'storage_location_value' assert response.disable_default_sink is True - -@pytest.mark.asyncio -async def test__get_settings_async_from_dict(): - await test__get_settings_async(request_type=dict) - def test__get_settings_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10478,8 +10508,10 @@ async def test__get_settings_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.UpdateSettingsRequest, - dict, + logging_config.UpdateSettingsRequest({ + }), + { + }, ]) def test__update_settings(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -10489,7 +10521,7 @@ def test__update_settings(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10614,7 +10646,11 @@ async def test__update_settings_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_settings_async(transport: str = 'grpc_asyncio', request_type=logging_config.UpdateSettingsRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.UpdateSettingsRequest({ }), + { }, +]) +async def test__update_settings_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10622,7 +10658,7 @@ async def test__update_settings_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10652,11 +10688,6 @@ async def test__update_settings_async(transport: str = 'grpc_asyncio', request_t assert response.storage_location == 'storage_location_value' assert response.disable_default_sink is True - -@pytest.mark.asyncio -async def test__update_settings_async_from_dict(): - await test__update_settings_async(request_type=dict) - def test__update_settings_field_headers(): client = BaseConfigServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -10813,8 +10844,10 @@ async def test__update_settings_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_config.CopyLogEntriesRequest, - dict, + logging_config.CopyLogEntriesRequest({ + }), + { + }, ]) def test__copy_log_entries(request_type, transport: str = 'grpc'): client = BaseConfigServiceV2Client( @@ -10824,7 +10857,7 @@ def test__copy_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10952,7 +10985,11 @@ async def test__copy_log_entries_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__copy_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging_config.CopyLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging_config.CopyLogEntriesRequest({ }), + { }, +]) +async def test__copy_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = BaseConfigServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -10960,7 +10997,7 @@ async def test__copy_log_entries_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -10982,11 +11019,6 @@ async def test__copy_log_entries_async(transport: str = 'grpc_asyncio', request_ assert isinstance(response, future.Future) -@pytest.mark.asyncio -async def test__copy_log_entries_async_from_dict(): - await test__copy_log_entries_async(request_type=dict) - - def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ConfigServiceV2GrpcTransport( diff --git a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_logging_service_v2.py index d7afda5d42ba..39a217dd73de 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -946,8 +946,10 @@ def test_logging_service_v2_client_create_channel_credentials_file(client_class, @pytest.mark.parametrize("request_type", [ - logging.DeleteLogRequest, - dict, + logging.DeleteLogRequest({ + }), + { + }, ]) def test_delete_log(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -957,7 +959,7 @@ def test_delete_log(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1071,7 +1073,11 @@ async def test_delete_log_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=logging.DeleteLogRequest): +@pytest.mark.parametrize("request_type", [ + logging.DeleteLogRequest({ }), + { }, +]) +async def test_delete_log_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1079,7 +1085,7 @@ async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=lo # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1098,11 +1104,6 @@ async def test_delete_log_async(transport: str = 'grpc_asyncio', request_type=lo # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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(), @@ -1249,8 +1250,10 @@ async def test_delete_log_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging.WriteLogEntriesRequest, - dict, + logging.WriteLogEntriesRequest({ + }), + { + }, ]) def test_write_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1260,7 +1263,7 @@ def test_write_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1375,7 +1378,11 @@ async def test_write_log_entries_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.WriteLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.WriteLogEntriesRequest({ }), + { }, +]) +async def test_write_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1383,7 +1390,7 @@ async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1404,11 +1411,6 @@ async def test_write_log_entries_async(transport: str = 'grpc_asyncio', request_ assert isinstance(response, logging.WriteLogEntriesResponse) -@pytest.mark.asyncio -async def test_write_log_entries_async_from_dict(): - await test_write_log_entries_async(request_type=dict) - - def test_write_log_entries_flattened(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1522,8 +1524,10 @@ async def test_write_log_entries_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging.ListLogEntriesRequest, - dict, + logging.ListLogEntriesRequest({ + }), + { + }, ]) def test_list_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1533,7 +1537,7 @@ def test_list_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1654,7 +1658,11 @@ async def test_list_log_entries_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.ListLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListLogEntriesRequest({ }), + { }, +]) +async def test_list_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1662,7 +1670,7 @@ async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1685,11 +1693,6 @@ async def test_list_log_entries_async(transport: str = 'grpc_asyncio', request_t assert response.next_page_token == 'next_page_token_value' -@pytest.mark.asyncio -async def test_list_log_entries_async_from_dict(): - await test_list_log_entries_async(request_type=dict) - - def test_list_log_entries_flattened(): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1982,8 +1985,10 @@ async def test_list_log_entries_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.ListMonitoredResourceDescriptorsRequest, - dict, + logging.ListMonitoredResourceDescriptorsRequest({ + }), + { + }, ]) def test_list_monitored_resource_descriptors(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -1993,7 +1998,7 @@ def test_list_monitored_resource_descriptors(request_type, transport: str = 'grp # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2110,7 +2115,11 @@ async def test_list_monitored_resource_descriptors_async_use_cached_wrapped_rpc( assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_asyncio', request_type=logging.ListMonitoredResourceDescriptorsRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListMonitoredResourceDescriptorsRequest({ }), + { }, +]) +async def test_list_monitored_resource_descriptors_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2118,7 +2127,7 @@ async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2141,11 +2150,6 @@ async def test_list_monitored_resource_descriptors_async(transport: str = 'grpc_ assert response.next_page_token == 'next_page_token_value' -@pytest.mark.asyncio -async def test_list_monitored_resource_descriptors_async_from_dict(): - await test_list_monitored_resource_descriptors_async(request_type=dict) - - def test_list_monitored_resource_descriptors_pager(transport_name: str = "grpc"): client = LoggingServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2336,8 +2340,10 @@ async def test_list_monitored_resource_descriptors_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.ListLogsRequest, - dict, + logging.ListLogsRequest({ + }), + { + }, ]) def test_list_logs(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -2347,7 +2353,7 @@ def test_list_logs(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2468,7 +2474,11 @@ async def test_list_logs_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=logging.ListLogsRequest): +@pytest.mark.parametrize("request_type", [ + logging.ListLogsRequest({ }), + { }, +]) +async def test_list_logs_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2476,7 +2486,7 @@ async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=log # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2500,11 +2510,6 @@ async def test_list_logs_async(transport: str = 'grpc_asyncio', request_type=log assert response.log_names == ['log_names_value'] assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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(), @@ -2845,8 +2850,10 @@ async def test_list_logs_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging.TailLogEntriesRequest, - dict, + logging.TailLogEntriesRequest({ + }), + { + }, ]) def test_tail_log_entries(request_type, transport: str = 'grpc'): client = LoggingServiceV2Client( @@ -2856,7 +2863,7 @@ def test_tail_log_entries(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type requests = [request] # Mock the actual call within the gRPC stub, and fake the request. @@ -2876,7 +2883,6 @@ def test_tail_log_entries(request_type, transport: str = 'grpc'): for message in response: assert isinstance(message, logging.TailLogEntriesResponse) - def test_tail_log_entries_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -2944,7 +2950,11 @@ async def test_tail_log_entries_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_type=logging.TailLogEntriesRequest): +@pytest.mark.parametrize("request_type", [ + logging.TailLogEntriesRequest({ }), + { }, +]) +async def test_tail_log_entries_async(request_type, transport: str = 'grpc_asyncio'): client = LoggingServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2952,7 +2962,7 @@ async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type requests = [request] # Mock the actual call within the gRPC stub, and fake the request. @@ -2974,11 +2984,6 @@ async def test_tail_log_entries_async(transport: str = 'grpc_asyncio', request_t assert isinstance(message, logging.TailLogEntriesResponse) -@pytest.mark.asyncio -async def test_tail_log_entries_async_from_dict(): - await test_tail_log_entries_async(request_type=dict) - - def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LoggingServiceV2GrpcTransport( diff --git a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index be4e396c2a3b..3815445e8dd4 100755 --- a/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/packages/gapic-generator/tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -944,8 +944,10 @@ def test_base_metrics_service_v2_client_create_channel_credentials_file(client_c @pytest.mark.parametrize("request_type", [ - logging_metrics.ListLogMetricsRequest, - dict, + logging_metrics.ListLogMetricsRequest({ + }), + { + }, ]) def test__list_log_metrics(request_type, transport: str = 'grpc'): client = BaseMetricsServiceV2Client( @@ -955,7 +957,7 @@ def test__list_log_metrics(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1074,7 +1076,11 @@ async def test__list_log_metrics_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__list_log_metrics_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.ListLogMetricsRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.ListLogMetricsRequest({ }), + { }, +]) +async def test__list_log_metrics_async(request_type, transport: str = 'grpc_asyncio'): client = BaseMetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1082,7 +1088,7 @@ async def test__list_log_metrics_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1104,11 +1110,6 @@ async def test__list_log_metrics_async(transport: str = 'grpc_asyncio', request_ assert isinstance(response, pagers.ListLogMetricsAsyncPager) assert response.next_page_token == 'next_page_token_value' - -@pytest.mark.asyncio -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 = BaseMetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1449,8 +1450,10 @@ async def test__list_log_metrics_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - logging_metrics.GetLogMetricRequest, - dict, + logging_metrics.GetLogMetricRequest({ + }), + { + }, ]) def test__get_log_metric(request_type, transport: str = 'grpc'): client = BaseMetricsServiceV2Client( @@ -1460,7 +1463,7 @@ def test__get_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1589,7 +1592,11 @@ async def test__get_log_metric_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__get_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.GetLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.GetLogMetricRequest({ }), + { }, +]) +async def test__get_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = BaseMetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1597,7 +1604,7 @@ async def test__get_log_metric_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1631,11 +1638,6 @@ async def test__get_log_metric_async(transport: str = 'grpc_asyncio', request_ty assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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 = BaseMetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -1782,8 +1784,10 @@ async def test__get_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.CreateLogMetricRequest, - dict, + logging_metrics.CreateLogMetricRequest({ + }), + { + }, ]) def test__create_log_metric(request_type, transport: str = 'grpc'): client = BaseMetricsServiceV2Client( @@ -1793,7 +1797,7 @@ def test__create_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1922,7 +1926,11 @@ async def test__create_log_metric_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__create_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.CreateLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.CreateLogMetricRequest({ }), + { }, +]) +async def test__create_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = BaseMetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1930,7 +1938,7 @@ async def test__create_log_metric_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1964,11 +1972,6 @@ async def test__create_log_metric_async(transport: str = 'grpc_asyncio', request assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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 = BaseMetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2125,8 +2128,10 @@ async def test__create_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.UpdateLogMetricRequest, - dict, + logging_metrics.UpdateLogMetricRequest({ + }), + { + }, ]) def test__update_log_metric(request_type, transport: str = 'grpc'): client = BaseMetricsServiceV2Client( @@ -2136,7 +2141,7 @@ def test__update_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2265,7 +2270,11 @@ async def test__update_log_metric_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__update_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.UpdateLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.UpdateLogMetricRequest({ }), + { }, +]) +async def test__update_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = BaseMetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2273,7 +2282,7 @@ async def test__update_log_metric_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2307,11 +2316,6 @@ async def test__update_log_metric_async(transport: str = 'grpc_asyncio', request assert response.value_extractor == 'value_extractor_value' assert response.version == logging_metrics.LogMetric.ApiVersion.V1 - -@pytest.mark.asyncio -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 = BaseMetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), @@ -2468,8 +2472,10 @@ async def test__update_log_metric_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - logging_metrics.DeleteLogMetricRequest, - dict, + logging_metrics.DeleteLogMetricRequest({ + }), + { + }, ]) def test__delete_log_metric(request_type, transport: str = 'grpc'): client = BaseMetricsServiceV2Client( @@ -2479,7 +2485,7 @@ def test__delete_log_metric(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2593,7 +2599,11 @@ async def test__delete_log_metric_async_use_cached_wrapped_rpc(transport: str = assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test__delete_log_metric_async(transport: str = 'grpc_asyncio', request_type=logging_metrics.DeleteLogMetricRequest): +@pytest.mark.parametrize("request_type", [ + logging_metrics.DeleteLogMetricRequest({ }), + { }, +]) +async def test__delete_log_metric_async(request_type, transport: str = 'grpc_asyncio'): client = BaseMetricsServiceV2AsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2601,7 +2611,7 @@ async def test__delete_log_metric_async(transport: str = 'grpc_asyncio', request # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2620,11 +2630,6 @@ async def test__delete_log_metric_async(transport: str = 'grpc_asyncio', request # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -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 = BaseMetricsServiceV2Client( credentials=ga_credentials.AnonymousCredentials(), diff --git a/packages/gapic-generator/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/packages/gapic-generator/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index bc2c0285caa3..ac8e281978fa 100755 --- a/packages/gapic-generator/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/packages/gapic-generator/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -973,8 +973,10 @@ def test_cloud_redis_client_create_channel_credentials_file(client_class, transp @pytest.mark.parametrize("request_type", [ - cloud_redis.ListInstancesRequest, - dict, + cloud_redis.ListInstancesRequest({ + }), + { + }, ]) def test_list_instances(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -984,7 +986,7 @@ def test_list_instances(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1105,7 +1107,11 @@ async def test_list_instances_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_instances_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.ListInstancesRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.ListInstancesRequest({ }), + { }, +]) +async def test_list_instances_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1113,7 +1119,7 @@ async def test_list_instances_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1137,11 +1143,6 @@ async def test_list_instances_async(transport: str = 'grpc_asyncio', request_typ assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -1482,8 +1483,10 @@ async def test_list_instances_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - cloud_redis.GetInstanceRequest, - dict, + cloud_redis.GetInstanceRequest({ + }), + { + }, ]) def test_get_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -1493,7 +1496,7 @@ def test_get_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1662,7 +1665,11 @@ async def test_get_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.GetInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.GetInstanceRequest({ }), + { }, +]) +async def test_get_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1670,7 +1677,7 @@ async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1744,11 +1751,6 @@ async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type= assert response.maintenance_version == 'maintenance_version_value' assert response.available_maintenance_versions == ['available_maintenance_versions_value'] - -@pytest.mark.asyncio -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(), @@ -1895,8 +1897,10 @@ async def test_get_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.GetInstanceAuthStringRequest, - dict, + cloud_redis.GetInstanceAuthStringRequest({ + }), + { + }, ]) def test_get_instance_auth_string(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -1906,7 +1910,7 @@ def test_get_instance_auth_string(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2023,7 +2027,11 @@ async def test_get_instance_auth_string_async_use_cached_wrapped_rpc(transport: assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_instance_auth_string_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.GetInstanceAuthStringRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.GetInstanceAuthStringRequest({ }), + { }, +]) +async def test_get_instance_auth_string_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2031,7 +2039,7 @@ async def test_get_instance_auth_string_async(transport: str = 'grpc_asyncio', r # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2053,11 +2061,6 @@ async def test_get_instance_auth_string_async(transport: str = 'grpc_asyncio', r assert isinstance(response, cloud_redis.InstanceAuthString) assert response.auth_string == 'auth_string_value' - -@pytest.mark.asyncio -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(), @@ -2204,8 +2207,10 @@ async def test_get_instance_auth_string_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.CreateInstanceRequest, - dict, + cloud_redis.CreateInstanceRequest({ + }), + { + }, ]) def test_create_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -2215,7 +2220,7 @@ def test_create_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2341,7 +2346,11 @@ async def test_create_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.CreateInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.CreateInstanceRequest({ }), + { }, +]) +async def test_create_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2349,7 +2358,7 @@ async def test_create_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2370,11 +2379,6 @@ async def test_create_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2543,8 +2547,10 @@ async def test_create_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.UpdateInstanceRequest, - dict, + cloud_redis.UpdateInstanceRequest({ + }), + { + }, ]) def test_update_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -2554,7 +2560,7 @@ def test_update_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2676,7 +2682,11 @@ async def test_update_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.UpdateInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.UpdateInstanceRequest({ }), + { }, +]) +async def test_update_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2684,7 +2694,7 @@ async def test_update_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2705,11 +2715,6 @@ async def test_update_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2868,8 +2873,10 @@ async def test_update_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.UpgradeInstanceRequest, - dict, + cloud_redis.UpgradeInstanceRequest({ + }), + { + }, ]) def test_upgrade_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -2879,7 +2886,7 @@ def test_upgrade_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3005,7 +3012,11 @@ async def test_upgrade_instance_async_use_cached_wrapped_rpc(transport: str = "g assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_upgrade_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.UpgradeInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.UpgradeInstanceRequest({ }), + { }, +]) +async def test_upgrade_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3013,7 +3024,7 @@ async def test_upgrade_instance_async(transport: str = 'grpc_asyncio', request_t # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3034,11 +3045,6 @@ async def test_upgrade_instance_async(transport: str = 'grpc_asyncio', request_t # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -3197,8 +3203,10 @@ async def test_upgrade_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.ImportInstanceRequest, - dict, + cloud_redis.ImportInstanceRequest({ + }), + { + }, ]) def test_import_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -3208,7 +3216,7 @@ def test_import_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3332,7 +3340,11 @@ async def test_import_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_import_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.ImportInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.ImportInstanceRequest({ }), + { }, +]) +async def test_import_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3340,7 +3352,7 @@ async def test_import_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3361,11 +3373,6 @@ async def test_import_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -3524,8 +3531,10 @@ async def test_import_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.ExportInstanceRequest, - dict, + cloud_redis.ExportInstanceRequest({ + }), + { + }, ]) def test_export_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -3535,7 +3544,7 @@ def test_export_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3659,7 +3668,11 @@ async def test_export_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_export_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.ExportInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.ExportInstanceRequest({ }), + { }, +]) +async def test_export_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3667,7 +3680,7 @@ async def test_export_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3688,11 +3701,6 @@ async def test_export_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -3851,8 +3859,10 @@ async def test_export_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.FailoverInstanceRequest, - dict, + cloud_redis.FailoverInstanceRequest({ + }), + { + }, ]) def test_failover_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -3862,7 +3872,7 @@ def test_failover_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3986,7 +3996,11 @@ async def test_failover_instance_async_use_cached_wrapped_rpc(transport: str = " assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_failover_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.FailoverInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.FailoverInstanceRequest({ }), + { }, +]) +async def test_failover_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3994,7 +4008,7 @@ async def test_failover_instance_async(transport: str = 'grpc_asyncio', request_ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4015,11 +4029,6 @@ async def test_failover_instance_async(transport: str = 'grpc_asyncio', request_ # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -4178,8 +4187,10 @@ async def test_failover_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.DeleteInstanceRequest, - dict, + cloud_redis.DeleteInstanceRequest({ + }), + { + }, ]) def test_delete_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -4189,7 +4200,7 @@ def test_delete_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4313,7 +4324,11 @@ async def test_delete_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.DeleteInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.DeleteInstanceRequest({ }), + { }, +]) +async def test_delete_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4321,7 +4336,7 @@ async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4342,11 +4357,6 @@ async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -4495,8 +4505,10 @@ async def test_delete_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.RescheduleMaintenanceRequest, - dict, + cloud_redis.RescheduleMaintenanceRequest({ + }), + { + }, ]) def test_reschedule_maintenance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -4506,7 +4518,7 @@ def test_reschedule_maintenance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4630,7 +4642,11 @@ async def test_reschedule_maintenance_async_use_cached_wrapped_rpc(transport: st assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_reschedule_maintenance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.RescheduleMaintenanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.RescheduleMaintenanceRequest({ }), + { }, +]) +async def test_reschedule_maintenance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -4638,7 +4654,7 @@ async def test_reschedule_maintenance_async(transport: str = 'grpc_asyncio', req # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4659,11 +4675,6 @@ async def test_reschedule_maintenance_async(transport: str = 'grpc_asyncio', req # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), diff --git a/packages/gapic-generator/tests/integration/goldens/redis_selective/tests/unit/gapic/redis_v1/test_cloud_redis.py b/packages/gapic-generator/tests/integration/goldens/redis_selective/tests/unit/gapic/redis_v1/test_cloud_redis.py index f6cea1dd2b5d..17a1b03206b1 100755 --- a/packages/gapic-generator/tests/integration/goldens/redis_selective/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/packages/gapic-generator/tests/integration/goldens/redis_selective/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -973,8 +973,10 @@ def test_cloud_redis_client_create_channel_credentials_file(client_class, transp @pytest.mark.parametrize("request_type", [ - cloud_redis.ListInstancesRequest, - dict, + cloud_redis.ListInstancesRequest({ + }), + { + }, ]) def test_list_instances(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -984,7 +986,7 @@ def test_list_instances(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1105,7 +1107,11 @@ async def test_list_instances_async_use_cached_wrapped_rpc(transport: str = "grp assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_instances_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.ListInstancesRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.ListInstancesRequest({ }), + { }, +]) +async def test_list_instances_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1113,7 +1119,7 @@ async def test_list_instances_async(transport: str = 'grpc_asyncio', request_typ # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1137,11 +1143,6 @@ async def test_list_instances_async(transport: str = 'grpc_asyncio', request_typ assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -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(), @@ -1482,8 +1483,10 @@ async def test_list_instances_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - cloud_redis.GetInstanceRequest, - dict, + cloud_redis.GetInstanceRequest({ + }), + { + }, ]) def test_get_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -1493,7 +1496,7 @@ def test_get_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1662,7 +1665,11 @@ async def test_get_instance_async_use_cached_wrapped_rpc(transport: str = "grpc_ assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.GetInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.GetInstanceRequest({ }), + { }, +]) +async def test_get_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1670,7 +1677,7 @@ async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type= # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1744,11 +1751,6 @@ async def test_get_instance_async(transport: str = 'grpc_asyncio', request_type= assert response.maintenance_version == 'maintenance_version_value' assert response.available_maintenance_versions == ['available_maintenance_versions_value'] - -@pytest.mark.asyncio -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(), @@ -1895,8 +1897,10 @@ async def test_get_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.CreateInstanceRequest, - dict, + cloud_redis.CreateInstanceRequest({ + }), + { + }, ]) def test_create_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -1906,7 +1910,7 @@ def test_create_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2032,7 +2036,11 @@ async def test_create_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.CreateInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.CreateInstanceRequest({ }), + { }, +]) +async def test_create_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2040,7 +2048,7 @@ async def test_create_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2061,11 +2069,6 @@ async def test_create_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2234,8 +2237,10 @@ async def test_create_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.UpdateInstanceRequest, - dict, + cloud_redis.UpdateInstanceRequest({ + }), + { + }, ]) def test_update_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -2245,7 +2250,7 @@ def test_update_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2367,7 +2372,11 @@ async def test_update_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_update_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.UpdateInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.UpdateInstanceRequest({ }), + { }, +]) +async def test_update_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2375,7 +2384,7 @@ async def test_update_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2396,11 +2405,6 @@ async def test_update_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), @@ -2559,8 +2563,10 @@ async def test_update_instance_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - cloud_redis.DeleteInstanceRequest, - dict, + cloud_redis.DeleteInstanceRequest({ + }), + { + }, ]) def test_delete_instance(request_type, transport: str = 'grpc'): client = CloudRedisClient( @@ -2570,7 +2576,7 @@ def test_delete_instance(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2694,7 +2700,11 @@ async def test_delete_instance_async_use_cached_wrapped_rpc(transport: str = "gr assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_type=cloud_redis.DeleteInstanceRequest): +@pytest.mark.parametrize("request_type", [ + cloud_redis.DeleteInstanceRequest({ }), + { }, +]) +async def test_delete_instance_async(request_type, transport: str = 'grpc_asyncio'): client = CloudRedisAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2702,7 +2712,7 @@ async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_ty # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2723,11 +2733,6 @@ async def test_delete_instance_async(transport: str = 'grpc_asyncio', request_ty # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -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(), diff --git a/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py index c637c8f077e0..155e57a8bc02 100755 --- a/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py +++ b/packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py @@ -964,8 +964,10 @@ def test_storage_batch_operations_client_create_channel_credentials_file(client_ @pytest.mark.parametrize("request_type", [ - storage_batch_operations.ListJobsRequest, - dict, + storage_batch_operations.ListJobsRequest({ + }), + { + }, ]) def test_list_jobs(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -975,7 +977,7 @@ def test_list_jobs(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1100,7 +1102,11 @@ async def test_list_jobs_async_use_cached_wrapped_rpc(transport: str = "grpc_asy assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_jobs_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.ListJobsRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.ListJobsRequest({ }), + { }, +]) +async def test_list_jobs_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1108,7 +1114,7 @@ async def test_list_jobs_async(transport: str = 'grpc_asyncio', request_type=sto # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1132,11 +1138,6 @@ async def test_list_jobs_async(transport: str = 'grpc_asyncio', request_type=sto assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_jobs_async_from_dict(): - await test_list_jobs_async(request_type=dict) - def test_list_jobs_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1477,8 +1478,10 @@ async def test_list_jobs_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - storage_batch_operations.GetJobRequest, - dict, + storage_batch_operations.GetJobRequest({ + }), + { + }, ]) def test_get_job(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -1488,7 +1491,7 @@ def test_get_job(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1613,7 +1616,11 @@ async def test_get_job_async_use_cached_wrapped_rpc(transport: str = "grpc_async assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_job_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.GetJobRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.GetJobRequest({ }), + { }, +]) +async def test_get_job_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1621,7 +1628,7 @@ async def test_get_job_async(transport: str = 'grpc_asyncio', request_type=stora # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1651,11 +1658,6 @@ async def test_get_job_async(transport: str = 'grpc_asyncio', request_type=stora assert response.dry_run is True assert response.is_multi_bucket_job is True - -@pytest.mark.asyncio -async def test_get_job_async_from_dict(): - await test_get_job_async(request_type=dict) - def test_get_job_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -1802,8 +1804,12 @@ async def test_get_job_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - storage_batch_operations.CreateJobRequest, - dict, + storage_batch_operations.CreateJobRequest({ + "request_id": "explicit value for autopopulate-able field", + }), + { + "request_id": "explicit value for autopopulate-able field", + }, ]) def test_create_job(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -1813,11 +1819,7 @@ def test_create_job(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1948,7 +1950,11 @@ async def test_create_job_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_create_job_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.CreateJobRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.CreateJobRequest({ "request_id": "explicit value for autopopulate-able field", }), + { "request_id": "explicit value for autopopulate-able field", }, +]) +async def test_create_job_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -1956,11 +1962,7 @@ async def test_create_job_async(transport: str = 'grpc_asyncio', request_type=st # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1982,11 +1984,6 @@ async def test_create_job_async(transport: str = 'grpc_asyncio', request_type=st # Establish that the response is the type that we expect. assert isinstance(response, future.Future) - -@pytest.mark.asyncio -async def test_create_job_async_from_dict(): - await test_create_job_async(request_type=dict) - def test_create_job_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2155,8 +2152,12 @@ async def test_create_job_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - storage_batch_operations.DeleteJobRequest, - dict, + storage_batch_operations.DeleteJobRequest({ + "request_id": "explicit value for autopopulate-able field", + }), + { + "request_id": "explicit value for autopopulate-able field", + }, ]) def test_delete_job(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -2166,11 +2167,7 @@ def test_delete_job(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2289,7 +2286,11 @@ async def test_delete_job_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_delete_job_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.DeleteJobRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.DeleteJobRequest({ "request_id": "explicit value for autopopulate-able field", }), + { "request_id": "explicit value for autopopulate-able field", }, +]) +async def test_delete_job_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2297,11 +2298,7 @@ async def test_delete_job_async(transport: str = 'grpc_asyncio', request_type=st # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2321,11 +2318,6 @@ async def test_delete_job_async(transport: str = 'grpc_asyncio', request_type=st # Establish that the response is the type that we expect. assert response is None - -@pytest.mark.asyncio -async def test_delete_job_async_from_dict(): - await test_delete_job_async(request_type=dict) - def test_delete_job_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2472,8 +2464,12 @@ async def test_delete_job_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - storage_batch_operations.CancelJobRequest, - dict, + storage_batch_operations.CancelJobRequest({ + "request_id": "explicit value for autopopulate-able field", + }), + { + "request_id": "explicit value for autopopulate-able field", + }, ]) def test_cancel_job(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -2483,11 +2479,7 @@ def test_cancel_job(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2607,7 +2599,11 @@ async def test_cancel_job_async_use_cached_wrapped_rpc(transport: str = "grpc_as assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_cancel_job_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.CancelJobRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.CancelJobRequest({ "request_id": "explicit value for autopopulate-able field", }), + { "request_id": "explicit value for autopopulate-able field", }, +]) +async def test_cancel_job_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2615,11 +2611,7 @@ async def test_cancel_job_async(transport: str = 'grpc_asyncio', request_type=st # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() - if isinstance(request, dict): - request['request_id'] = "explicit value for autopopulate-able field" - else: - request.request_id = "explicit value for autopopulate-able field" + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2640,11 +2632,6 @@ async def test_cancel_job_async(transport: str = 'grpc_asyncio', request_type=st # Establish that the response is the type that we expect. assert isinstance(response, storage_batch_operations.CancelJobResponse) - -@pytest.mark.asyncio -async def test_cancel_job_async_from_dict(): - await test_cancel_job_async(request_type=dict) - def test_cancel_job_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2791,8 +2778,10 @@ async def test_cancel_job_flattened_error_async(): @pytest.mark.parametrize("request_type", [ - storage_batch_operations.ListBucketOperationsRequest, - dict, + storage_batch_operations.ListBucketOperationsRequest({ + }), + { + }, ]) def test_list_bucket_operations(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -2802,7 +2791,7 @@ def test_list_bucket_operations(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2927,7 +2916,11 @@ async def test_list_bucket_operations_async_use_cached_wrapped_rpc(transport: st assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_list_bucket_operations_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.ListBucketOperationsRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.ListBucketOperationsRequest({ }), + { }, +]) +async def test_list_bucket_operations_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -2935,7 +2928,7 @@ async def test_list_bucket_operations_async(transport: str = 'grpc_asyncio', req # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2959,11 +2952,6 @@ async def test_list_bucket_operations_async(transport: str = 'grpc_asyncio', req assert response.next_page_token == 'next_page_token_value' assert response.unreachable == ['unreachable_value'] - -@pytest.mark.asyncio -async def test_list_bucket_operations_async_from_dict(): - await test_list_bucket_operations_async(request_type=dict) - def test_list_bucket_operations_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3304,8 +3292,10 @@ async def test_list_bucket_operations_async_pages(): assert page_.raw_page.next_page_token == token @pytest.mark.parametrize("request_type", [ - storage_batch_operations.GetBucketOperationRequest, - dict, + storage_batch_operations.GetBucketOperationRequest({ + }), + { + }, ]) def test_get_bucket_operation(request_type, transport: str = 'grpc'): client = StorageBatchOperationsClient( @@ -3315,7 +3305,7 @@ def test_get_bucket_operation(request_type, transport: str = 'grpc'): # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3436,7 +3426,11 @@ async def test_get_bucket_operation_async_use_cached_wrapped_rpc(transport: str assert mock_rpc.call_count == 2 @pytest.mark.asyncio -async def test_get_bucket_operation_async(transport: str = 'grpc_asyncio', request_type=storage_batch_operations.GetBucketOperationRequest): +@pytest.mark.parametrize("request_type", [ + storage_batch_operations.GetBucketOperationRequest({ }), + { }, +]) +async def test_get_bucket_operation_async(request_type, transport: str = 'grpc_asyncio'): client = StorageBatchOperationsAsyncClient( credentials=async_anonymous_credentials(), transport=transport, @@ -3444,7 +3438,7 @@ async def test_get_bucket_operation_async(transport: str = 'grpc_asyncio', reque # Everything is optional in proto3 as far as the runtime is concerned, # and we are mocking out the actual API, so just send an empty request. - request = request_type() + request = request_type # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3470,11 +3464,6 @@ async def test_get_bucket_operation_async(transport: str = 'grpc_asyncio', reque assert response.bucket_name == 'bucket_name_value' assert response.state == storage_batch_operations_types.BucketOperation.State.QUEUED - -@pytest.mark.asyncio -async def test_get_bucket_operation_async_from_dict(): - await test_get_bucket_operation_async(request_type=dict) - def test_get_bucket_operation_field_headers(): client = StorageBatchOperationsClient( credentials=ga_credentials.AnonymousCredentials(),