diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 6891b5a5157f..43d472543252 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -104,7 +104,6 @@ def __init__( credentials, _ = google.auth.load_credentials_from_file( credentials_file, **scopes_kwargs, quota_project_id=quota_project_id ) - elif credentials is None: credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id diff --git a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 90c2b27db98f..4568aef606b0 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -245,20 +245,20 @@ def test_datastream_client_client_options( # unsupported value. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): with pytest.raises(MutualTLSChannelError): - client = client_class() + client = client_class(transport=transport_name) # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. with mock.patch.dict( os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} ): with pytest.raises(ValueError): - client = client_class() + client = client_class(transport=transport_name) # Check the case quota_project_id is provided options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -315,7 +315,7 @@ def test_datastream_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) if use_client_cert_env == "false": expected_client_cert_source = None @@ -410,7 +410,7 @@ def test_datastream_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -441,7 +441,7 @@ def test_datastream_client_client_options_credentials_file( options = client_options.ClientOptions(credentials_file="credentials.json") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -472,9 +472,10 @@ def test_datastream_client_client_options_from_dict(): ) -def test_list_connection_profiles( - transport: str = "grpc", request_type=datastream.ListConnectionProfilesRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.ListConnectionProfilesRequest, dict,] +) +def test_list_connection_profiles(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -504,10 +505,6 @@ def test_list_connection_profiles( assert response.unreachable == ["unreachable_value"] -def test_list_connection_profiles_from_dict(): - test_list_connection_profiles(request_type=dict) - - def test_list_connection_profiles_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -694,8 +691,10 @@ async def test_list_connection_profiles_flattened_error_async(): ) -def test_list_connection_profiles_pager(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_connection_profiles_pager(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -742,8 +741,10 @@ def test_list_connection_profiles_pager(): ) -def test_list_connection_profiles_pages(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_connection_profiles_pages(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -868,9 +869,10 @@ async def test_list_connection_profiles_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_connection_profile( - transport: str = "grpc", request_type=datastream.GetConnectionProfileRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.GetConnectionProfileRequest, dict,] +) +def test_get_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -905,10 +907,6 @@ def test_get_connection_profile( assert response.display_name == "display_name_value" -def test_get_connection_profile_from_dict(): - test_get_connection_profile(request_type=dict) - - def test_get_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1093,9 +1091,10 @@ async def test_get_connection_profile_flattened_error_async(): ) -def test_create_connection_profile( - transport: str = "grpc", request_type=datastream.CreateConnectionProfileRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.CreateConnectionProfileRequest, dict,] +) +def test_create_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1121,10 +1120,6 @@ def test_create_connection_profile( assert isinstance(response, future.Future) -def test_create_connection_profile_from_dict(): - test_create_connection_profile(request_type=dict) - - def test_create_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1340,9 +1335,10 @@ async def test_create_connection_profile_flattened_error_async(): ) -def test_update_connection_profile( - transport: str = "grpc", request_type=datastream.UpdateConnectionProfileRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.UpdateConnectionProfileRequest, dict,] +) +def test_update_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1368,10 +1364,6 @@ def test_update_connection_profile( assert isinstance(response, future.Future) -def test_update_connection_profile_from_dict(): - test_update_connection_profile(request_type=dict) - - def test_update_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1583,9 +1575,10 @@ async def test_update_connection_profile_flattened_error_async(): ) -def test_delete_connection_profile( - transport: str = "grpc", request_type=datastream.DeleteConnectionProfileRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.DeleteConnectionProfileRequest, dict,] +) +def test_delete_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1611,10 +1604,6 @@ def test_delete_connection_profile( assert isinstance(response, future.Future) -def test_delete_connection_profile_from_dict(): - test_delete_connection_profile(request_type=dict) - - def test_delete_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1796,9 +1785,10 @@ async def test_delete_connection_profile_flattened_error_async(): ) -def test_discover_connection_profile( - transport: str = "grpc", request_type=datastream.DiscoverConnectionProfileRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.DiscoverConnectionProfileRequest, dict,] +) +def test_discover_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1830,10 +1820,6 @@ def test_discover_connection_profile( assert isinstance(response, datastream.DiscoverConnectionProfileResponse) -def test_discover_connection_profile_from_dict(): - test_discover_connection_profile(request_type=dict) - - def test_discover_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1943,9 +1929,8 @@ async def test_discover_connection_profile_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_streams( - transport: str = "grpc", request_type=datastream.ListStreamsRequest -): +@pytest.mark.parametrize("request_type", [datastream.ListStreamsRequest, dict,]) +def test_list_streams(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1973,10 +1958,6 @@ def test_list_streams( assert response.unreachable == ["unreachable_value"] -def test_list_streams_from_dict(): - test_list_streams(request_type=dict) - - def test_list_streams_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2150,8 +2131,10 @@ async def test_list_streams_flattened_error_async(): ) -def test_list_streams_pager(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_streams_pager(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2188,8 +2171,10 @@ def test_list_streams_pager(): assert all(isinstance(i, datastream_resources.Stream) for i in results) -def test_list_streams_pages(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_streams_pages(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2288,7 +2273,8 @@ async def test_list_streams_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_stream(transport: str = "grpc", request_type=datastream.GetStreamRequest): +@pytest.mark.parametrize("request_type", [datastream.GetStreamRequest, dict,]) +def test_get_stream(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2328,10 +2314,6 @@ def test_get_stream(transport: str = "grpc", request_type=datastream.GetStreamRe assert response.state == datastream_resources.Stream.State.CREATED -def test_get_stream_from_dict(): - test_get_stream(request_type=dict) - - def test_get_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2507,9 +2489,8 @@ async def test_get_stream_flattened_error_async(): ) -def test_create_stream( - transport: str = "grpc", request_type=datastream.CreateStreamRequest -): +@pytest.mark.parametrize("request_type", [datastream.CreateStreamRequest, dict,]) +def test_create_stream(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2533,10 +2514,6 @@ def test_create_stream( assert isinstance(response, future.Future) -def test_create_stream_from_dict(): - test_create_stream(request_type=dict) - - def test_create_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2731,9 +2708,8 @@ async def test_create_stream_flattened_error_async(): ) -def test_update_stream( - transport: str = "grpc", request_type=datastream.UpdateStreamRequest -): +@pytest.mark.parametrize("request_type", [datastream.UpdateStreamRequest, dict,]) +def test_update_stream(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2757,10 +2733,6 @@ def test_update_stream( assert isinstance(response, future.Future) -def test_update_stream_from_dict(): - test_update_stream(request_type=dict) - - def test_update_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2945,9 +2917,8 @@ async def test_update_stream_flattened_error_async(): ) -def test_delete_stream( - transport: str = "grpc", request_type=datastream.DeleteStreamRequest -): +@pytest.mark.parametrize("request_type", [datastream.DeleteStreamRequest, dict,]) +def test_delete_stream(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2971,10 +2942,6 @@ def test_delete_stream( assert isinstance(response, future.Future) -def test_delete_stream_from_dict(): - test_delete_stream(request_type=dict) - - def test_delete_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3143,9 +3110,8 @@ async def test_delete_stream_flattened_error_async(): ) -def test_fetch_errors( - transport: str = "grpc", request_type=datastream.FetchErrorsRequest -): +@pytest.mark.parametrize("request_type", [datastream.FetchErrorsRequest, dict,]) +def test_fetch_errors(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3169,10 +3135,6 @@ def test_fetch_errors( assert isinstance(response, future.Future) -def test_fetch_errors_from_dict(): - test_fetch_errors(request_type=dict) - - def test_fetch_errors_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3273,9 +3235,8 @@ async def test_fetch_errors_field_headers_async(): assert ("x-goog-request-params", "stream=stream/value",) in kw["metadata"] -def test_fetch_static_ips( - transport: str = "grpc", request_type=datastream.FetchStaticIpsRequest -): +@pytest.mark.parametrize("request_type", [datastream.FetchStaticIpsRequest, dict,]) +def test_fetch_static_ips(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3303,10 +3264,6 @@ def test_fetch_static_ips( assert response.next_page_token == "next_page_token_value" -def test_fetch_static_ips_from_dict(): - test_fetch_static_ips(request_type=dict) - - def test_fetch_static_ips_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3480,8 +3437,10 @@ async def test_fetch_static_ips_flattened_error_async(): ) -def test_fetch_static_ips_pager(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_fetch_static_ips_pager(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3511,8 +3470,10 @@ def test_fetch_static_ips_pager(): assert all(isinstance(i, str) for i in results) -def test_fetch_static_ips_pages(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_fetch_static_ips_pages(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3590,9 +3551,10 @@ async def test_fetch_static_ips_async_pages(): assert page_.raw_page.next_page_token == token -def test_create_private_connection( - transport: str = "grpc", request_type=datastream.CreatePrivateConnectionRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.CreatePrivateConnectionRequest, dict,] +) +def test_create_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3618,10 +3580,6 @@ def test_create_private_connection( assert isinstance(response, future.Future) -def test_create_private_connection_from_dict(): - test_create_private_connection(request_type=dict) - - def test_create_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -3837,9 +3795,10 @@ async def test_create_private_connection_flattened_error_async(): ) -def test_get_private_connection( - transport: str = "grpc", request_type=datastream.GetPrivateConnectionRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.GetPrivateConnectionRequest, dict,] +) +def test_get_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3872,10 +3831,6 @@ def test_get_private_connection( assert response.state == datastream_resources.PrivateConnection.State.CREATING -def test_get_private_connection_from_dict(): - test_get_private_connection(request_type=dict) - - def test_get_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -4063,9 +4018,10 @@ async def test_get_private_connection_flattened_error_async(): ) -def test_list_private_connections( - transport: str = "grpc", request_type=datastream.ListPrivateConnectionsRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.ListPrivateConnectionsRequest, dict,] +) +def test_list_private_connections(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4095,10 +4051,6 @@ def test_list_private_connections( assert response.unreachable == ["unreachable_value"] -def test_list_private_connections_from_dict(): - test_list_private_connections(request_type=dict) - - def test_list_private_connections_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -4285,8 +4237,10 @@ async def test_list_private_connections_flattened_error_async(): ) -def test_list_private_connections_pager(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_private_connections_pager(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4333,8 +4287,10 @@ def test_list_private_connections_pager(): ) -def test_list_private_connections_pages(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_private_connections_pages(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4459,9 +4415,10 @@ async def test_list_private_connections_async_pages(): assert page_.raw_page.next_page_token == token -def test_delete_private_connection( - transport: str = "grpc", request_type=datastream.DeletePrivateConnectionRequest -): +@pytest.mark.parametrize( + "request_type", [datastream.DeletePrivateConnectionRequest, dict,] +) +def test_delete_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4487,10 +4444,6 @@ def test_delete_private_connection( assert isinstance(response, future.Future) -def test_delete_private_connection_from_dict(): - test_delete_private_connection(request_type=dict) - - def test_delete_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -4672,9 +4625,8 @@ async def test_delete_private_connection_flattened_error_async(): ) -def test_create_route( - transport: str = "grpc", request_type=datastream.CreateRouteRequest -): +@pytest.mark.parametrize("request_type", [datastream.CreateRouteRequest, dict,]) +def test_create_route(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4698,10 +4650,6 @@ def test_create_route( assert isinstance(response, future.Future) -def test_create_route_from_dict(): - test_create_route(request_type=dict) - - def test_create_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -4896,7 +4844,8 @@ async def test_create_route_flattened_error_async(): ) -def test_get_route(transport: str = "grpc", request_type=datastream.GetRouteRequest): +@pytest.mark.parametrize("request_type", [datastream.GetRouteRequest, dict,]) +def test_get_route(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4929,10 +4878,6 @@ def test_get_route(transport: str = "grpc", request_type=datastream.GetRouteRequ assert response.destination_port == 1734 -def test_get_route_from_dict(): - test_get_route(request_type=dict) - - def test_get_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -5110,9 +5055,8 @@ async def test_get_route_flattened_error_async(): ) -def test_list_routes( - transport: str = "grpc", request_type=datastream.ListRoutesRequest -): +@pytest.mark.parametrize("request_type", [datastream.ListRoutesRequest, dict,]) +def test_list_routes(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5140,10 +5084,6 @@ def test_list_routes( assert response.unreachable == ["unreachable_value"] -def test_list_routes_from_dict(): - test_list_routes(request_type=dict) - - def test_list_routes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -5317,8 +5257,10 @@ async def test_list_routes_flattened_error_async(): ) -def test_list_routes_pager(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_routes_pager(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -5355,8 +5297,10 @@ def test_list_routes_pager(): assert all(isinstance(i, datastream_resources.Route) for i in results) -def test_list_routes_pages(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_routes_pages(transport_name: str = "grpc"): + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -5455,9 +5399,8 @@ async def test_list_routes_async_pages(): assert page_.raw_page.next_page_token == token -def test_delete_route( - transport: str = "grpc", request_type=datastream.DeleteRouteRequest -): +@pytest.mark.parametrize("request_type", [datastream.DeleteRouteRequest, dict,]) +def test_delete_route(request_type, transport: str = "grpc"): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5481,10 +5424,6 @@ def test_delete_route( assert isinstance(response, future.Future) -def test_delete_route_from_dict(): - test_delete_route(request_type=dict) - - def test_delete_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -6282,7 +6221,7 @@ def test_parse_common_location_path(): assert expected == actual -def test_client_withDEFAULT_CLIENT_INFO(): +def test_client_with_default_client_info(): client_info = gapic_v1.client_info.ClientInfo() with mock.patch.object(