diff --git a/google/pubsub_v1/services/publisher/async_client.py b/google/pubsub_v1/services/publisher/async_client.py index 204b534fc..fbe6216f0 100644 --- a/google/pubsub_v1/services/publisher/async_client.py +++ b/google/pubsub_v1/services/publisher/async_client.py @@ -224,9 +224,9 @@ async def create_topic( from google import pubsub_v1 - def sample_create_topic(): + async def sample_create_topic(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.Topic( @@ -234,7 +234,7 @@ def sample_create_topic(): ) # Make the request - response = client.create_topic(request=request) + response = await client.create_topic(request=request) # Handle the response print(response) @@ -332,9 +332,9 @@ async def update_topic( from google import pubsub_v1 - def sample_update_topic(): + async def sample_update_topic(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) topic = pubsub_v1.Topic() @@ -345,7 +345,7 @@ def sample_update_topic(): ) # Make the request - response = client.update_topic(request=request) + response = await client.update_topic(request=request) # Handle the response print(response) @@ -420,9 +420,9 @@ async def publish( from google import pubsub_v1 - def sample_publish(): + async def sample_publish(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.PublishRequest( @@ -430,7 +430,7 @@ def sample_publish(): ) # Make the request - response = client.publish(request=request) + response = await client.publish(request=request) # Handle the response print(response) @@ -536,9 +536,9 @@ async def get_topic( from google import pubsub_v1 - def sample_get_topic(): + async def sample_get_topic(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.GetTopicRequest( @@ -546,7 +546,7 @@ def sample_get_topic(): ) # Make the request - response = client.get_topic(request=request) + response = await client.get_topic(request=request) # Handle the response print(response) @@ -640,9 +640,9 @@ async def list_topics( from google import pubsub_v1 - def sample_list_topics(): + async def sample_list_topics(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListTopicsRequest( @@ -653,7 +653,7 @@ def sample_list_topics(): page_result = client.list_topics(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -759,9 +759,9 @@ async def list_topic_subscriptions( from google import pubsub_v1 - def sample_list_topic_subscriptions(): + async def sample_list_topic_subscriptions(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListTopicSubscriptionsRequest( @@ -772,7 +772,7 @@ def sample_list_topic_subscriptions(): page_result = client.list_topic_subscriptions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -884,9 +884,9 @@ async def list_topic_snapshots( from google import pubsub_v1 - def sample_list_topic_snapshots(): + async def sample_list_topic_snapshots(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListTopicSnapshotsRequest( @@ -897,7 +897,7 @@ def sample_list_topic_snapshots(): page_result = client.list_topic_snapshots(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1009,9 +1009,9 @@ async def delete_topic( from google import pubsub_v1 - def sample_delete_topic(): + async def sample_delete_topic(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.DeleteTopicRequest( @@ -1019,7 +1019,7 @@ def sample_delete_topic(): ) # Make the request - client.delete_topic(request=request) + await client.delete_topic(request=request) Args: request (Union[google.pubsub_v1.types.DeleteTopicRequest, dict]): @@ -1105,9 +1105,9 @@ async def detach_subscription( from google import pubsub_v1 - def sample_detach_subscription(): + async def sample_detach_subscription(): # Create a client - client = pubsub_v1.PublisherClient() + client = pubsub_v1.PublisherAsyncClient() # Initialize request argument(s) request = pubsub_v1.DetachSubscriptionRequest( @@ -1115,7 +1115,7 @@ def sample_detach_subscription(): ) # Make the request - response = client.detach_subscription(request=request) + response = await client.detach_subscription(request=request) # Handle the response print(response) diff --git a/google/pubsub_v1/services/schema_service/async_client.py b/google/pubsub_v1/services/schema_service/async_client.py index 169d71fdf..b0831fe09 100644 --- a/google/pubsub_v1/services/schema_service/async_client.py +++ b/google/pubsub_v1/services/schema_service/async_client.py @@ -222,9 +222,9 @@ async def create_schema( from google import pubsub_v1 - def sample_create_schema(): + async def sample_create_schema(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) schema = pubsub_v1.Schema() @@ -236,7 +236,7 @@ def sample_create_schema(): ) # Make the request - response = client.create_schema(request=request) + response = await client.create_schema(request=request) # Handle the response print(response) @@ -343,9 +343,9 @@ async def get_schema( from google import pubsub_v1 - def sample_get_schema(): + async def sample_get_schema(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) request = pubsub_v1.GetSchemaRequest( @@ -353,7 +353,7 @@ def sample_get_schema(): ) # Make the request - response = client.get_schema(request=request) + response = await client.get_schema(request=request) # Handle the response print(response) @@ -435,9 +435,9 @@ async def list_schemas( from google import pubsub_v1 - def sample_list_schemas(): + async def sample_list_schemas(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListSchemasRequest( @@ -448,7 +448,7 @@ def sample_list_schemas(): page_result = client.list_schemas(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -542,9 +542,9 @@ async def delete_schema( from google import pubsub_v1 - def sample_delete_schema(): + async def sample_delete_schema(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) request = pubsub_v1.DeleteSchemaRequest( @@ -552,7 +552,7 @@ def sample_delete_schema(): ) # Make the request - client.delete_schema(request=request) + await client.delete_schema(request=request) Args: request (Union[google.pubsub_v1.types.DeleteSchemaRequest, dict]): @@ -626,9 +626,9 @@ async def validate_schema( from google import pubsub_v1 - def sample_validate_schema(): + async def sample_validate_schema(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) schema = pubsub_v1.Schema() @@ -640,7 +640,7 @@ def sample_validate_schema(): ) # Make the request - response = client.validate_schema(request=request) + response = await client.validate_schema(request=request) # Handle the response print(response) @@ -733,9 +733,9 @@ async def validate_message( from google import pubsub_v1 - def sample_validate_message(): + async def sample_validate_message(): # Create a client - client = pubsub_v1.SchemaServiceClient() + client = pubsub_v1.SchemaServiceAsyncClient() # Initialize request argument(s) request = pubsub_v1.ValidateMessageRequest( @@ -744,7 +744,7 @@ def sample_validate_message(): ) # Make the request - response = client.validate_message(request=request) + response = await client.validate_message(request=request) # Handle the response print(response) diff --git a/google/pubsub_v1/services/subscriber/async_client.py b/google/pubsub_v1/services/subscriber/async_client.py index cc67b66e5..acfc54a12 100644 --- a/google/pubsub_v1/services/subscriber/async_client.py +++ b/google/pubsub_v1/services/subscriber/async_client.py @@ -250,9 +250,9 @@ async def create_subscription( from google import pubsub_v1 - def sample_create_subscription(): + async def sample_create_subscription(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.Subscription( @@ -261,7 +261,7 @@ def sample_create_subscription(): ) # Make the request - response = client.create_subscription(request=request) + response = await client.create_subscription(request=request) # Handle the response print(response) @@ -415,9 +415,9 @@ async def get_subscription( from google import pubsub_v1 - def sample_get_subscription(): + async def sample_get_subscription(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.GetSubscriptionRequest( @@ -425,7 +425,7 @@ def sample_get_subscription(): ) # Make the request - response = client.get_subscription(request=request) + response = await client.get_subscription(request=request) # Handle the response print(response) @@ -522,9 +522,9 @@ async def update_subscription( from google import pubsub_v1 - def sample_update_subscription(): + async def sample_update_subscription(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) subscription = pubsub_v1.Subscription() @@ -536,7 +536,7 @@ def sample_update_subscription(): ) # Make the request - response = client.update_subscription(request=request) + response = await client.update_subscription(request=request) # Handle the response print(response) @@ -609,9 +609,9 @@ async def list_subscriptions( from google import pubsub_v1 - def sample_list_subscriptions(): + async def sample_list_subscriptions(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListSubscriptionsRequest( @@ -622,7 +622,7 @@ def sample_list_subscriptions(): page_result = client.list_subscriptions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -732,9 +732,9 @@ async def delete_subscription( from google import pubsub_v1 - def sample_delete_subscription(): + async def sample_delete_subscription(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.DeleteSubscriptionRequest( @@ -742,7 +742,7 @@ def sample_delete_subscription(): ) # Make the request - client.delete_subscription(request=request) + await client.delete_subscription(request=request) Args: request (Union[google.pubsub_v1.types.DeleteSubscriptionRequest, dict]): @@ -833,9 +833,9 @@ async def modify_ack_deadline( from google import pubsub_v1 - def sample_modify_ack_deadline(): + async def sample_modify_ack_deadline(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.ModifyAckDeadlineRequest( @@ -845,7 +845,7 @@ def sample_modify_ack_deadline(): ) # Make the request - client.modify_ack_deadline(request=request) + await client.modify_ack_deadline(request=request) Args: request (Union[google.pubsub_v1.types.ModifyAckDeadlineRequest, dict]): @@ -962,9 +962,9 @@ async def acknowledge( from google import pubsub_v1 - def sample_acknowledge(): + async def sample_acknowledge(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.AcknowledgeRequest( @@ -973,7 +973,7 @@ def sample_acknowledge(): ) # Make the request - client.acknowledge(request=request) + await client.acknowledge(request=request) Args: request (Union[google.pubsub_v1.types.AcknowledgeRequest, dict]): @@ -1071,9 +1071,9 @@ async def pull( from google import pubsub_v1 - def sample_pull(): + async def sample_pull(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.PullRequest( @@ -1082,7 +1082,7 @@ def sample_pull(): ) # Make the request - response = client.pull(request=request) + response = await client.pull(request=request) # Handle the response print(response) @@ -1218,9 +1218,9 @@ def streaming_pull( from google import pubsub_v1 - def sample_streaming_pull(): + async def sample_streaming_pull(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.StreamingPullRequest( @@ -1239,10 +1239,10 @@ def request_generator(): yield request # Make the request - stream = client.streaming_pull(requests=request_generator()) + stream = await client.streaming_pull(requests=request_generator()) # Handle the response - for response in stream: + async for response in stream: print(response) Args: @@ -1319,9 +1319,9 @@ async def modify_push_config( from google import pubsub_v1 - def sample_modify_push_config(): + async def sample_modify_push_config(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.ModifyPushConfigRequest( @@ -1329,7 +1329,7 @@ def sample_modify_push_config(): ) # Make the request - client.modify_push_config(request=request) + await client.modify_push_config(request=request) Args: request (Union[google.pubsub_v1.types.ModifyPushConfigRequest, dict]): @@ -1433,9 +1433,9 @@ async def get_snapshot( from google import pubsub_v1 - def sample_get_snapshot(): + async def sample_get_snapshot(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.GetSnapshotRequest( @@ -1443,7 +1443,7 @@ def sample_get_snapshot(): ) # Make the request - response = client.get_snapshot(request=request) + response = await client.get_snapshot(request=request) # Handle the response print(response) @@ -1546,9 +1546,9 @@ async def list_snapshots( from google import pubsub_v1 - def sample_list_snapshots(): + async def sample_list_snapshots(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.ListSnapshotsRequest( @@ -1559,7 +1559,7 @@ def sample_list_snapshots(): page_result = client.list_snapshots(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1683,9 +1683,9 @@ async def create_snapshot( from google import pubsub_v1 - def sample_create_snapshot(): + async def sample_create_snapshot(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.CreateSnapshotRequest( @@ -1694,7 +1694,7 @@ def sample_create_snapshot(): ) # Make the request - response = client.create_snapshot(request=request) + response = await client.create_snapshot(request=request) # Handle the response print(response) @@ -1820,16 +1820,16 @@ async def update_snapshot( from google import pubsub_v1 - def sample_update_snapshot(): + async def sample_update_snapshot(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.UpdateSnapshotRequest( ) # Make the request - response = client.update_snapshot(request=request) + response = await client.update_snapshot(request=request) # Handle the response print(response) @@ -1917,9 +1917,9 @@ async def delete_snapshot( from google import pubsub_v1 - def sample_delete_snapshot(): + async def sample_delete_snapshot(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.DeleteSnapshotRequest( @@ -1927,7 +1927,7 @@ def sample_delete_snapshot(): ) # Make the request - client.delete_snapshot(request=request) + await client.delete_snapshot(request=request) Args: request (Union[google.pubsub_v1.types.DeleteSnapshotRequest, dict]): @@ -2016,9 +2016,9 @@ async def seek( from google import pubsub_v1 - def sample_seek(): + async def sample_seek(): # Create a client - client = pubsub_v1.SubscriberClient() + client = pubsub_v1.SubscriberAsyncClient() # Initialize request argument(s) request = pubsub_v1.SeekRequest( @@ -2026,7 +2026,7 @@ def sample_seek(): ) # Make the request - response = client.seek(request=request) + response = await client.seek(request=request) # Handle the response print(response) diff --git a/tests/unit/gapic/pubsub_v1/test_publisher.py b/tests/unit/gapic/pubsub_v1/test_publisher.py index de81d0c13..c5ab354d6 100644 --- a/tests/unit/gapic/pubsub_v1/test_publisher.py +++ b/tests/unit/gapic/pubsub_v1/test_publisher.py @@ -736,7 +736,7 @@ def test_create_topic_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.Topic() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_topic), "__call__") as call: @@ -752,7 +752,7 @@ def test_create_topic_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -766,7 +766,7 @@ async def test_create_topic_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.Topic() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_topic), "__call__") as call: @@ -782,7 +782,7 @@ async def test_create_topic_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -972,7 +972,7 @@ def test_update_topic_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.UpdateTopicRequest() - request.topic.name = "topic.name/value" + request.topic.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_topic), "__call__") as call: @@ -988,7 +988,7 @@ def test_update_topic_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic.name=topic.name/value", + "topic.name=name_value", ) in kw["metadata"] @@ -1002,7 +1002,7 @@ async def test_update_topic_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.UpdateTopicRequest() - request.topic.name = "topic.name/value" + request.topic.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_topic), "__call__") as call: @@ -1018,7 +1018,7 @@ async def test_update_topic_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic.name=topic.name/value", + "topic.name=name_value", ) in kw["metadata"] @@ -1120,7 +1120,7 @@ def test_publish_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.PublishRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.publish), "__call__") as call: @@ -1136,7 +1136,7 @@ def test_publish_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -1150,7 +1150,7 @@ async def test_publish_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.PublishRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.publish), "__call__") as call: @@ -1168,7 +1168,7 @@ async def test_publish_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -1370,7 +1370,7 @@ def test_get_topic_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.GetTopicRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_topic), "__call__") as call: @@ -1386,7 +1386,7 @@ def test_get_topic_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -1400,7 +1400,7 @@ async def test_get_topic_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.GetTopicRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_topic), "__call__") as call: @@ -1416,7 +1416,7 @@ async def test_get_topic_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -1598,7 +1598,7 @@ def test_list_topics_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_topics), "__call__") as call: @@ -1614,7 +1614,7 @@ def test_list_topics_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -1628,7 +1628,7 @@ async def test_list_topics_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_topics), "__call__") as call: @@ -1646,7 +1646,7 @@ async def test_list_topics_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -1777,7 +1777,7 @@ def test_list_topics_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, pubsub.Topic) for i in results) @@ -2028,7 +2028,7 @@ def test_list_topic_subscriptions_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicSubscriptionsRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2046,7 +2046,7 @@ def test_list_topic_subscriptions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -2060,7 +2060,7 @@ async def test_list_topic_subscriptions_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicSubscriptionsRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2080,7 +2080,7 @@ async def test_list_topic_subscriptions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -2217,7 +2217,7 @@ def test_list_topic_subscriptions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, str) for i in results) @@ -2474,7 +2474,7 @@ def test_list_topic_snapshots_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicSnapshotsRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2492,7 +2492,7 @@ def test_list_topic_snapshots_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -2506,7 +2506,7 @@ async def test_list_topic_snapshots_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ListTopicSnapshotsRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2526,7 +2526,7 @@ async def test_list_topic_snapshots_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -2663,7 +2663,7 @@ def test_list_topic_snapshots_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, str) for i in results) @@ -2902,7 +2902,7 @@ def test_delete_topic_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.DeleteTopicRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_topic), "__call__") as call: @@ -2918,7 +2918,7 @@ def test_delete_topic_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -2932,7 +2932,7 @@ async def test_delete_topic_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.DeleteTopicRequest() - request.topic = "topic/value" + request.topic = "topic_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_topic), "__call__") as call: @@ -2948,7 +2948,7 @@ async def test_delete_topic_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "topic=topic/value", + "topic=topic_value", ) in kw["metadata"] @@ -3130,7 +3130,7 @@ def test_detach_subscription_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.DetachSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3148,7 +3148,7 @@ def test_detach_subscription_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -3162,7 +3162,7 @@ async def test_detach_subscription_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.DetachSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3182,7 +3182,7 @@ async def test_detach_subscription_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/pubsub_v1/test_schema_service.py b/tests/unit/gapic/pubsub_v1/test_schema_service.py index b35750e7f..852e4ef3b 100644 --- a/tests/unit/gapic/pubsub_v1/test_schema_service.py +++ b/tests/unit/gapic/pubsub_v1/test_schema_service.py @@ -760,7 +760,7 @@ def test_create_schema_field_headers(): # a field header. Set these to a non-empty value. request = gp_schema.CreateSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_schema), "__call__") as call: @@ -776,7 +776,7 @@ def test_create_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -790,7 +790,7 @@ async def test_create_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = gp_schema.CreateSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_schema), "__call__") as call: @@ -806,7 +806,7 @@ async def test_create_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1016,7 +1016,7 @@ def test_get_schema_field_headers(): # a field header. Set these to a non-empty value. request = schema.GetSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_schema), "__call__") as call: @@ -1032,7 +1032,7 @@ def test_get_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1046,7 +1046,7 @@ async def test_get_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = schema.GetSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_schema), "__call__") as call: @@ -1062,7 +1062,7 @@ async def test_get_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1244,7 +1244,7 @@ def test_list_schemas_field_headers(): # a field header. Set these to a non-empty value. request = schema.ListSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_schemas), "__call__") as call: @@ -1260,7 +1260,7 @@ def test_list_schemas_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1274,7 +1274,7 @@ async def test_list_schemas_field_headers_async(): # a field header. Set these to a non-empty value. request = schema.ListSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_schemas), "__call__") as call: @@ -1292,7 +1292,7 @@ async def test_list_schemas_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1423,7 +1423,7 @@ def test_list_schemas_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, schema.Schema) for i in results) @@ -1656,7 +1656,7 @@ def test_delete_schema_field_headers(): # a field header. Set these to a non-empty value. request = schema.DeleteSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_schema), "__call__") as call: @@ -1672,7 +1672,7 @@ def test_delete_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1686,7 +1686,7 @@ async def test_delete_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = schema.DeleteSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_schema), "__call__") as call: @@ -1702,7 +1702,7 @@ async def test_delete_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1878,7 +1878,7 @@ def test_validate_schema_field_headers(): # a field header. Set these to a non-empty value. request = gp_schema.ValidateSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.validate_schema), "__call__") as call: @@ -1894,7 +1894,7 @@ def test_validate_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1908,7 +1908,7 @@ async def test_validate_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = gp_schema.ValidateSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.validate_schema), "__call__") as call: @@ -1926,7 +1926,7 @@ async def test_validate_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2114,7 +2114,7 @@ def test_validate_message_field_headers(): # a field header. Set these to a non-empty value. request = schema.ValidateMessageRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.validate_message), "__call__") as call: @@ -2130,7 +2130,7 @@ def test_validate_message_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2144,7 +2144,7 @@ async def test_validate_message_field_headers_async(): # a field header. Set these to a non-empty value. request = schema.ValidateMessageRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.validate_message), "__call__") as call: @@ -2162,7 +2162,7 @@ async def test_validate_message_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/pubsub_v1/test_subscriber.py b/tests/unit/gapic/pubsub_v1/test_subscriber.py index d9146f11c..cbccac582 100644 --- a/tests/unit/gapic/pubsub_v1/test_subscriber.py +++ b/tests/unit/gapic/pubsub_v1/test_subscriber.py @@ -766,7 +766,7 @@ def test_create_subscription_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.Subscription() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -784,7 +784,7 @@ def test_create_subscription_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -798,7 +798,7 @@ async def test_create_subscription_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.Subscription() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -816,7 +816,7 @@ async def test_create_subscription_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1060,7 +1060,7 @@ def test_get_subscription_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.GetSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_subscription), "__call__") as call: @@ -1076,7 +1076,7 @@ def test_get_subscription_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -1090,7 +1090,7 @@ async def test_get_subscription_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.GetSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_subscription), "__call__") as call: @@ -1106,7 +1106,7 @@ async def test_get_subscription_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -1322,7 +1322,7 @@ def test_update_subscription_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.UpdateSubscriptionRequest() - request.subscription.name = "subscription.name/value" + request.subscription.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1340,7 +1340,7 @@ def test_update_subscription_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription.name=subscription.name/value", + "subscription.name=name_value", ) in kw["metadata"] @@ -1354,7 +1354,7 @@ async def test_update_subscription_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.UpdateSubscriptionRequest() - request.subscription.name = "subscription.name/value" + request.subscription.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1372,7 +1372,7 @@ async def test_update_subscription_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription.name=subscription.name/value", + "subscription.name=name_value", ) in kw["metadata"] @@ -1480,7 +1480,7 @@ def test_list_subscriptions_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ListSubscriptionsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1498,7 +1498,7 @@ def test_list_subscriptions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -1512,7 +1512,7 @@ async def test_list_subscriptions_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ListSubscriptionsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1532,7 +1532,7 @@ async def test_list_subscriptions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -1669,7 +1669,7 @@ def test_list_subscriptions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, pubsub.Subscription) for i in results) @@ -1914,7 +1914,7 @@ def test_delete_subscription_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.DeleteSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1932,7 +1932,7 @@ def test_delete_subscription_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -1946,7 +1946,7 @@ async def test_delete_subscription_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.DeleteSubscriptionRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1964,7 +1964,7 @@ async def test_delete_subscription_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2148,7 +2148,7 @@ def test_modify_ack_deadline_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ModifyAckDeadlineRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2166,7 +2166,7 @@ def test_modify_ack_deadline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2180,7 +2180,7 @@ async def test_modify_ack_deadline_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ModifyAckDeadlineRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2198,7 +2198,7 @@ async def test_modify_ack_deadline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2396,7 +2396,7 @@ def test_acknowledge_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.AcknowledgeRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge), "__call__") as call: @@ -2412,7 +2412,7 @@ def test_acknowledge_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2426,7 +2426,7 @@ async def test_acknowledge_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.AcknowledgeRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge), "__call__") as call: @@ -2442,7 +2442,7 @@ async def test_acknowledge_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2626,7 +2626,7 @@ def test_pull_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.PullRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pull), "__call__") as call: @@ -2642,7 +2642,7 @@ def test_pull_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2656,7 +2656,7 @@ async def test_pull_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.PullRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pull), "__call__") as call: @@ -2672,7 +2672,7 @@ async def test_pull_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2948,7 +2948,7 @@ def test_modify_push_config_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ModifyPushConfigRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2966,7 +2966,7 @@ def test_modify_push_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -2980,7 +2980,7 @@ async def test_modify_push_config_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ModifyPushConfigRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2998,7 +2998,7 @@ async def test_modify_push_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -3198,7 +3198,7 @@ def test_get_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.GetSnapshotRequest() - request.snapshot = "snapshot/value" + request.snapshot = "snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: @@ -3214,7 +3214,7 @@ def test_get_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot=snapshot/value", + "snapshot=snapshot_value", ) in kw["metadata"] @@ -3228,7 +3228,7 @@ async def test_get_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.GetSnapshotRequest() - request.snapshot = "snapshot/value" + request.snapshot = "snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: @@ -3244,7 +3244,7 @@ async def test_get_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot=snapshot/value", + "snapshot=snapshot_value", ) in kw["metadata"] @@ -3426,7 +3426,7 @@ def test_list_snapshots_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.ListSnapshotsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_snapshots), "__call__") as call: @@ -3442,7 +3442,7 @@ def test_list_snapshots_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -3456,7 +3456,7 @@ async def test_list_snapshots_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.ListSnapshotsRequest() - request.project = "project/value" + request.project = "project_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_snapshots), "__call__") as call: @@ -3474,7 +3474,7 @@ async def test_list_snapshots_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "project=project/value", + "project=project_value", ) in kw["metadata"] @@ -3605,7 +3605,7 @@ def test_list_snapshots_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, pubsub.Snapshot) for i in results) @@ -3850,7 +3850,7 @@ def test_create_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.CreateSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_snapshot), "__call__") as call: @@ -3866,7 +3866,7 @@ def test_create_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3880,7 +3880,7 @@ async def test_create_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.CreateSnapshotRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_snapshot), "__call__") as call: @@ -3896,7 +3896,7 @@ async def test_create_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4092,7 +4092,7 @@ def test_update_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.UpdateSnapshotRequest() - request.snapshot.name = "snapshot.name/value" + request.snapshot.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_snapshot), "__call__") as call: @@ -4108,7 +4108,7 @@ def test_update_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot.name=snapshot.name/value", + "snapshot.name=name_value", ) in kw["metadata"] @@ -4122,7 +4122,7 @@ async def test_update_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.UpdateSnapshotRequest() - request.snapshot.name = "snapshot.name/value" + request.snapshot.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_snapshot), "__call__") as call: @@ -4138,7 +4138,7 @@ async def test_update_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot.name=snapshot.name/value", + "snapshot.name=name_value", ) in kw["metadata"] @@ -4232,7 +4232,7 @@ def test_delete_snapshot_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.DeleteSnapshotRequest() - request.snapshot = "snapshot/value" + request.snapshot = "snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: @@ -4248,7 +4248,7 @@ def test_delete_snapshot_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot=snapshot/value", + "snapshot=snapshot_value", ) in kw["metadata"] @@ -4262,7 +4262,7 @@ async def test_delete_snapshot_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.DeleteSnapshotRequest() - request.snapshot = "snapshot/value" + request.snapshot = "snapshot_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: @@ -4278,7 +4278,7 @@ async def test_delete_snapshot_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "snapshot=snapshot/value", + "snapshot=snapshot_value", ) in kw["metadata"] @@ -4452,7 +4452,7 @@ def test_seek_field_headers(): # a field header. Set these to a non-empty value. request = pubsub.SeekRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.seek), "__call__") as call: @@ -4468,7 +4468,7 @@ def test_seek_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"] @@ -4482,7 +4482,7 @@ async def test_seek_field_headers_async(): # a field header. Set these to a non-empty value. request = pubsub.SeekRequest() - request.subscription = "subscription/value" + request.subscription = "subscription_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.seek), "__call__") as call: @@ -4498,7 +4498,7 @@ async def test_seek_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "subscription=subscription/value", + "subscription=subscription_value", ) in kw["metadata"]