diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py index c5d38710bf..34989553d5 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py @@ -246,9 +246,9 @@ async def list_databases( from google.cloud import spanner_admin_database_v1 - def sample_list_databases(): + async def sample_list_databases(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.ListDatabasesRequest( @@ -259,7 +259,7 @@ def sample_list_databases(): page_result = client.list_databases(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -375,9 +375,9 @@ async def create_database( from google.cloud import spanner_admin_database_v1 - def sample_create_database(): + async def sample_create_database(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.CreateDatabaseRequest( @@ -390,7 +390,7 @@ def sample_create_database(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -501,9 +501,9 @@ async def get_database( from google.cloud import spanner_admin_database_v1 - def sample_get_database(): + async def sample_get_database(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.GetDatabaseRequest( @@ -511,7 +511,7 @@ def sample_get_database(): ) # Make the request - response = client.get_database(request=request) + response = await client.get_database(request=request) # Handle the response print(response) @@ -614,9 +614,9 @@ async def update_database_ddl( from google.cloud import spanner_admin_database_v1 - def sample_update_database_ddl(): + async def sample_update_database_ddl(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.UpdateDatabaseDdlRequest( @@ -629,7 +629,7 @@ def sample_update_database_ddl(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -772,9 +772,9 @@ async def drop_database( from google.cloud import spanner_admin_database_v1 - def sample_drop_database(): + async def sample_drop_database(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.DropDatabaseRequest( @@ -782,7 +782,7 @@ def sample_drop_database(): ) # Make the request - client.drop_database(request=request) + await client.drop_database(request=request) Args: request (Union[google.cloud.spanner_admin_database_v1.types.DropDatabaseRequest, dict]): @@ -866,9 +866,9 @@ async def get_database_ddl( from google.cloud import spanner_admin_database_v1 - def sample_get_database_ddl(): + async def sample_get_database_ddl(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.GetDatabaseDdlRequest( @@ -876,7 +876,7 @@ def sample_get_database_ddl(): ) # Make the request - response = client.get_database_ddl(request=request) + response = await client.get_database_ddl(request=request) # Handle the response print(response) @@ -981,9 +981,9 @@ async def set_iam_policy( from google.cloud import spanner_admin_database_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -991,7 +991,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1149,9 +1149,9 @@ async def get_iam_policy( from google.cloud import spanner_admin_database_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1159,7 +1159,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1328,9 +1328,9 @@ async def test_iam_permissions( from google.cloud import spanner_admin_database_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1339,7 +1339,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -1450,9 +1450,9 @@ async def create_backup( from google.cloud import spanner_admin_database_v1 - def sample_create_backup(): + async def sample_create_backup(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.CreateBackupRequest( @@ -1465,7 +1465,7 @@ def sample_create_backup(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1599,9 +1599,9 @@ async def copy_backup( from google.cloud import spanner_admin_database_v1 - def sample_copy_backup(): + async def sample_copy_backup(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.CopyBackupRequest( @@ -1615,7 +1615,7 @@ def sample_copy_backup(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1751,9 +1751,9 @@ async def get_backup( from google.cloud import spanner_admin_database_v1 - def sample_get_backup(): + async def sample_get_backup(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.GetBackupRequest( @@ -1761,7 +1761,7 @@ def sample_get_backup(): ) # Make the request - response = client.get_backup(request=request) + response = await client.get_backup(request=request) # Handle the response print(response) @@ -1856,16 +1856,16 @@ async def update_backup( from google.cloud import spanner_admin_database_v1 - def sample_update_backup(): + async def sample_update_backup(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.UpdateBackupRequest( ) # Make the request - response = client.update_backup(request=request) + response = await client.update_backup(request=request) # Handle the response print(response) @@ -1979,9 +1979,9 @@ async def delete_backup( from google.cloud import spanner_admin_database_v1 - def sample_delete_backup(): + async def sample_delete_backup(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.DeleteBackupRequest( @@ -1989,7 +1989,7 @@ def sample_delete_backup(): ) # Make the request - client.delete_backup(request=request) + await client.delete_backup(request=request) Args: request (Union[google.cloud.spanner_admin_database_v1.types.DeleteBackupRequest, dict]): @@ -2075,9 +2075,9 @@ async def list_backups( from google.cloud import spanner_admin_database_v1 - def sample_list_backups(): + async def sample_list_backups(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.ListBackupsRequest( @@ -2088,7 +2088,7 @@ def sample_list_backups(): page_result = client.list_backups(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2213,9 +2213,9 @@ async def restore_database( from google.cloud import spanner_admin_database_v1 - def sample_restore_database(): + async def sample_restore_database(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.RestoreDatabaseRequest( @@ -2229,7 +2229,7 @@ def sample_restore_database(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2361,9 +2361,9 @@ async def list_database_operations( from google.cloud import spanner_admin_database_v1 - def sample_list_database_operations(): + async def sample_list_database_operations(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.ListDatabaseOperationsRequest( @@ -2374,7 +2374,7 @@ def sample_list_database_operations(): page_result = client.list_database_operations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2491,9 +2491,9 @@ async def list_backup_operations( from google.cloud import spanner_admin_database_v1 - def sample_list_backup_operations(): + async def sample_list_backup_operations(): # Create a client - client = spanner_admin_database_v1.DatabaseAdminClient() + client = spanner_admin_database_v1.DatabaseAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_database_v1.ListBackupOperationsRequest( @@ -2504,7 +2504,7 @@ def sample_list_backup_operations(): page_result = client.list_backup_operations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py index 4bbd9558c2..df6936aac3 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py @@ -248,9 +248,9 @@ async def list_instance_configs( from google.cloud import spanner_admin_instance_v1 - def sample_list_instance_configs(): + async def sample_list_instance_configs(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.ListInstanceConfigsRequest( @@ -261,7 +261,7 @@ def sample_list_instance_configs(): page_result = client.list_instance_configs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -368,9 +368,9 @@ async def get_instance_config( from google.cloud import spanner_admin_instance_v1 - def sample_get_instance_config(): + async def sample_get_instance_config(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.GetInstanceConfigRequest( @@ -378,7 +378,7 @@ def sample_get_instance_config(): ) # Make the request - response = client.get_instance_config(request=request) + response = await client.get_instance_config(request=request) # Handle the response print(response) @@ -476,9 +476,9 @@ async def list_instances( from google.cloud import spanner_admin_instance_v1 - def sample_list_instances(): + async def sample_list_instances(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.ListInstancesRequest( @@ -489,7 +489,7 @@ def sample_list_instances(): page_result = client.list_instances(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -595,9 +595,9 @@ async def get_instance( from google.cloud import spanner_admin_instance_v1 - def sample_get_instance(): + async def sample_get_instance(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.GetInstanceRequest( @@ -605,7 +605,7 @@ def sample_get_instance(): ) # Make the request - response = client.get_instance(request=request) + response = await client.get_instance(request=request) # Handle the response print(response) @@ -740,9 +740,9 @@ async def create_instance( from google.cloud import spanner_admin_instance_v1 - def sample_create_instance(): + async def sample_create_instance(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) instance = spanner_admin_instance_v1.Instance() @@ -761,7 +761,7 @@ def sample_create_instance(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -923,9 +923,9 @@ async def update_instance( from google.cloud import spanner_admin_instance_v1 - def sample_update_instance(): + async def sample_update_instance(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) instance = spanner_admin_instance_v1.Instance() @@ -942,7 +942,7 @@ def sample_update_instance(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1068,9 +1068,9 @@ async def delete_instance( from google.cloud import spanner_admin_instance_v1 - def sample_delete_instance(): + async def sample_delete_instance(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.DeleteInstanceRequest( @@ -1078,7 +1078,7 @@ def sample_delete_instance(): ) # Make the request - client.delete_instance(request=request) + await client.delete_instance(request=request) Args: request (Union[google.cloud.spanner_admin_instance_v1.types.DeleteInstanceRequest, dict]): @@ -1167,9 +1167,9 @@ async def set_iam_policy( from google.cloud import spanner_admin_instance_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1177,7 +1177,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1331,9 +1331,9 @@ async def get_iam_policy( from google.cloud import spanner_admin_instance_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1341,7 +1341,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1507,9 +1507,9 @@ async def test_iam_permissions( from google.cloud import spanner_admin_instance_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = spanner_admin_instance_v1.InstanceAdminClient() + client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1518,7 +1518,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) diff --git a/google/cloud/spanner_v1/services/spanner/async_client.py b/google/cloud/spanner_v1/services/spanner/async_client.py index e831c1c9b4..7721e7610d 100644 --- a/google/cloud/spanner_v1/services/spanner/async_client.py +++ b/google/cloud/spanner_v1/services/spanner/async_client.py @@ -249,9 +249,9 @@ async def create_session( from google.cloud import spanner_v1 - def sample_create_session(): + async def sample_create_session(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.CreateSessionRequest( @@ -259,7 +259,7 @@ def sample_create_session(): ) # Make the request - response = client.create_session(request=request) + response = await client.create_session(request=request) # Handle the response print(response) @@ -355,9 +355,9 @@ async def batch_create_sessions( from google.cloud import spanner_v1 - def sample_batch_create_sessions(): + async def sample_batch_create_sessions(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.BatchCreateSessionsRequest( @@ -366,7 +366,7 @@ def sample_batch_create_sessions(): ) # Make the request - response = client.batch_create_sessions(request=request) + response = await client.batch_create_sessions(request=request) # Handle the response print(response) @@ -476,9 +476,9 @@ async def get_session( from google.cloud import spanner_v1 - def sample_get_session(): + async def sample_get_session(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.GetSessionRequest( @@ -486,7 +486,7 @@ def sample_get_session(): ) # Make the request - response = client.get_session(request=request) + response = await client.get_session(request=request) # Handle the response print(response) @@ -578,9 +578,9 @@ async def list_sessions( from google.cloud import spanner_v1 - def sample_list_sessions(): + async def sample_list_sessions(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.ListSessionsRequest( @@ -591,7 +591,7 @@ def sample_list_sessions(): page_result = client.list_sessions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -697,9 +697,9 @@ async def delete_session( from google.cloud import spanner_v1 - def sample_delete_session(): + async def sample_delete_session(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.DeleteSessionRequest( @@ -707,7 +707,7 @@ def sample_delete_session(): ) # Make the request - client.delete_session(request=request) + await client.delete_session(request=request) Args: request (Union[google.cloud.spanner_v1.types.DeleteSessionRequest, dict]): @@ -801,9 +801,9 @@ async def execute_sql( from google.cloud import spanner_v1 - def sample_execute_sql(): + async def sample_execute_sql(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.ExecuteSqlRequest( @@ -812,7 +812,7 @@ def sample_execute_sql(): ) # Make the request - response = client.execute_sql(request=request) + response = await client.execute_sql(request=request) # Handle the response print(response) @@ -890,9 +890,9 @@ def execute_streaming_sql( from google.cloud import spanner_v1 - def sample_execute_streaming_sql(): + async def sample_execute_streaming_sql(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.ExecuteSqlRequest( @@ -901,10 +901,10 @@ def sample_execute_streaming_sql(): ) # Make the request - stream = client.execute_streaming_sql(request=request) + stream = await client.execute_streaming_sql(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: @@ -982,9 +982,9 @@ async def execute_batch_dml( from google.cloud import spanner_v1 - def sample_execute_batch_dml(): + async def sample_execute_batch_dml(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) statements = spanner_v1.Statement() @@ -997,7 +997,7 @@ def sample_execute_batch_dml(): ) # Make the request - response = client.execute_batch_dml(request=request) + response = await client.execute_batch_dml(request=request) # Handle the response print(response) @@ -1120,9 +1120,9 @@ async def read( from google.cloud import spanner_v1 - def sample_read(): + async def sample_read(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.ReadRequest( @@ -1132,7 +1132,7 @@ def sample_read(): ) # Make the request - response = client.read(request=request) + response = await client.read(request=request) # Handle the response print(response) @@ -1210,9 +1210,9 @@ def streaming_read( from google.cloud import spanner_v1 - def sample_streaming_read(): + async def sample_streaming_read(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.ReadRequest( @@ -1222,10 +1222,10 @@ def sample_streaming_read(): ) # Make the request - stream = client.streaming_read(request=request) + stream = await client.streaming_read(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: @@ -1296,9 +1296,9 @@ async def begin_transaction( from google.cloud import spanner_v1 - def sample_begin_transaction(): + async def sample_begin_transaction(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.BeginTransactionRequest( @@ -1306,7 +1306,7 @@ def sample_begin_transaction(): ) # Make the request - response = client.begin_transaction(request=request) + response = await client.begin_transaction(request=request) # Handle the response print(response) @@ -1425,9 +1425,9 @@ async def commit( from google.cloud import spanner_v1 - def sample_commit(): + async def sample_commit(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.CommitRequest( @@ -1436,7 +1436,7 @@ def sample_commit(): ) # Make the request - response = client.commit(request=request) + response = await client.commit(request=request) # Handle the response print(response) @@ -1579,9 +1579,9 @@ async def rollback( from google.cloud import spanner_v1 - def sample_rollback(): + async def sample_rollback(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.RollbackRequest( @@ -1590,7 +1590,7 @@ def sample_rollback(): ) # Make the request - client.rollback(request=request) + await client.rollback(request=request) Args: request (Union[google.cloud.spanner_v1.types.RollbackRequest, dict]): @@ -1693,9 +1693,9 @@ async def partition_query( from google.cloud import spanner_v1 - def sample_partition_query(): + async def sample_partition_query(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.PartitionQueryRequest( @@ -1704,7 +1704,7 @@ def sample_partition_query(): ) # Make the request - response = client.partition_query(request=request) + response = await client.partition_query(request=request) # Handle the response print(response) @@ -1793,9 +1793,9 @@ async def partition_read( from google.cloud import spanner_v1 - def sample_partition_read(): + async def sample_partition_read(): # Create a client - client = spanner_v1.SpannerClient() + client = spanner_v1.SpannerAsyncClient() # Initialize request argument(s) request = spanner_v1.PartitionReadRequest( @@ -1804,7 +1804,7 @@ def sample_partition_read(): ) # Make the request - response = client.partition_read(request=request) + response = await client.partition_read(request=request) # Handle the response print(response) diff --git a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py index bf1a442f66..07a90bc8b1 100644 --- a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py +++ b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py @@ -768,7 +768,7 @@ def test_list_databases_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.ListDatabasesRequest() - 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_databases), "__call__") as call: @@ -784,7 +784,7 @@ def test_list_databases_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -798,7 +798,7 @@ async def test_list_databases_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.ListDatabasesRequest() - 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_databases), "__call__") as call: @@ -816,7 +816,7 @@ async def test_list_databases_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -947,7 +947,7 @@ def test_list_databases_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, spanner_database_admin.Database) for i in results) @@ -1183,7 +1183,7 @@ def test_create_database_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.CreateDatabaseRequest() - 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_database), "__call__") as call: @@ -1199,7 +1199,7 @@ def test_create_database_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1213,7 +1213,7 @@ async def test_create_database_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.CreateDatabaseRequest() - 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_database), "__call__") as call: @@ -1231,7 +1231,7 @@ async def test_create_database_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1442,7 +1442,7 @@ def test_get_database_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.GetDatabaseRequest() - 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_database), "__call__") as call: @@ -1458,7 +1458,7 @@ def test_get_database_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1472,7 +1472,7 @@ async def test_get_database_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.GetDatabaseRequest() - 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_database), "__call__") as call: @@ -1490,7 +1490,7 @@ async def test_get_database_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1675,7 +1675,7 @@ def test_update_database_ddl_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.UpdateDatabaseDdlRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1693,7 +1693,7 @@ def test_update_database_ddl_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1707,7 +1707,7 @@ async def test_update_database_ddl_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.UpdateDatabaseDdlRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1727,7 +1727,7 @@ async def test_update_database_ddl_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1918,7 +1918,7 @@ def test_drop_database_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.DropDatabaseRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.drop_database), "__call__") as call: @@ -1934,7 +1934,7 @@ def test_drop_database_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1948,7 +1948,7 @@ async def test_drop_database_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.DropDatabaseRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.drop_database), "__call__") as call: @@ -1964,7 +1964,7 @@ async def test_drop_database_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -2147,7 +2147,7 @@ def test_get_database_ddl_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.GetDatabaseDdlRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_database_ddl), "__call__") as call: @@ -2163,7 +2163,7 @@ def test_get_database_ddl_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -2177,7 +2177,7 @@ async def test_get_database_ddl_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.GetDatabaseDdlRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_database_ddl), "__call__") as call: @@ -2195,7 +2195,7 @@ async def test_get_database_ddl_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -2383,7 +2383,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2399,7 +2399,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2413,7 +2413,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2429,7 +2429,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2633,7 +2633,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2649,7 +2649,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2663,7 +2663,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2679,7 +2679,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2885,7 +2885,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2903,7 +2903,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2917,7 +2917,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2937,7 +2937,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3148,7 +3148,7 @@ def test_create_backup_field_headers(): # a field header. Set these to a non-empty value. request = gsad_backup.CreateBackupRequest() - 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_backup), "__call__") as call: @@ -3164,7 +3164,7 @@ def test_create_backup_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3178,7 +3178,7 @@ async def test_create_backup_field_headers_async(): # a field header. Set these to a non-empty value. request = gsad_backup.CreateBackupRequest() - 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_backup), "__call__") as call: @@ -3196,7 +3196,7 @@ async def test_create_backup_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3394,7 +3394,7 @@ def test_copy_backup_field_headers(): # a field header. Set these to a non-empty value. request = backup.CopyBackupRequest() - 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.copy_backup), "__call__") as call: @@ -3410,7 +3410,7 @@ def test_copy_backup_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3424,7 +3424,7 @@ async def test_copy_backup_field_headers_async(): # a field header. Set these to a non-empty value. request = backup.CopyBackupRequest() - 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.copy_backup), "__call__") as call: @@ -3442,7 +3442,7 @@ async def test_copy_backup_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3680,7 +3680,7 @@ def test_get_backup_field_headers(): # a field header. Set these to a non-empty value. request = backup.GetBackupRequest() - 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_backup), "__call__") as call: @@ -3696,7 +3696,7 @@ def test_get_backup_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3710,7 +3710,7 @@ async def test_get_backup_field_headers_async(): # a field header. Set these to a non-empty value. request = backup.GetBackupRequest() - 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_backup), "__call__") as call: @@ -3726,7 +3726,7 @@ async def test_get_backup_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3932,7 +3932,7 @@ def test_update_backup_field_headers(): # a field header. Set these to a non-empty value. request = gsad_backup.UpdateBackupRequest() - request.backup.name = "backup.name/value" + request.backup.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_backup), "__call__") as call: @@ -3948,7 +3948,7 @@ def test_update_backup_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "backup.name=backup.name/value", + "backup.name=name_value", ) in kw["metadata"] @@ -3962,7 +3962,7 @@ async def test_update_backup_field_headers_async(): # a field header. Set these to a non-empty value. request = gsad_backup.UpdateBackupRequest() - request.backup.name = "backup.name/value" + request.backup.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_backup), "__call__") as call: @@ -3978,7 +3978,7 @@ async def test_update_backup_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "backup.name=backup.name/value", + "backup.name=name_value", ) in kw["metadata"] @@ -4162,7 +4162,7 @@ def test_delete_backup_field_headers(): # a field header. Set these to a non-empty value. request = backup.DeleteBackupRequest() - 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_backup), "__call__") as call: @@ -4178,7 +4178,7 @@ def test_delete_backup_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4192,7 +4192,7 @@ async def test_delete_backup_field_headers_async(): # a field header. Set these to a non-empty value. request = backup.DeleteBackupRequest() - 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_backup), "__call__") as call: @@ -4208,7 +4208,7 @@ async def test_delete_backup_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4390,7 +4390,7 @@ def test_list_backups_field_headers(): # a field header. Set these to a non-empty value. request = backup.ListBackupsRequest() - 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_backups), "__call__") as call: @@ -4406,7 +4406,7 @@ def test_list_backups_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4420,7 +4420,7 @@ async def test_list_backups_field_headers_async(): # a field header. Set these to a non-empty value. request = backup.ListBackupsRequest() - 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_backups), "__call__") as call: @@ -4438,7 +4438,7 @@ async def test_list_backups_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4569,7 +4569,7 @@ def test_list_backups_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, backup.Backup) for i in results) @@ -4805,7 +4805,7 @@ def test_restore_database_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.RestoreDatabaseRequest() - 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.restore_database), "__call__") as call: @@ -4821,7 +4821,7 @@ def test_restore_database_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4835,7 +4835,7 @@ async def test_restore_database_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.RestoreDatabaseRequest() - 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.restore_database), "__call__") as call: @@ -4853,7 +4853,7 @@ async def test_restore_database_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5060,7 +5060,7 @@ def test_list_database_operations_field_headers(): # a field header. Set these to a non-empty value. request = spanner_database_admin.ListDatabaseOperationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5078,7 +5078,7 @@ def test_list_database_operations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5092,7 +5092,7 @@ async def test_list_database_operations_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_database_admin.ListDatabaseOperationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5112,7 +5112,7 @@ async def test_list_database_operations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5249,7 +5249,7 @@ def test_list_database_operations_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, operations_pb2.Operation) for i in results) @@ -5502,7 +5502,7 @@ def test_list_backup_operations_field_headers(): # a field header. Set these to a non-empty value. request = backup.ListBackupOperationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5520,7 +5520,7 @@ def test_list_backup_operations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5534,7 +5534,7 @@ async def test_list_backup_operations_field_headers_async(): # a field header. Set these to a non-empty value. request = backup.ListBackupOperationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5554,7 +5554,7 @@ async def test_list_backup_operations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5691,7 +5691,7 @@ def test_list_backup_operations_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, operations_pb2.Operation) for i in results) diff --git a/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py b/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py index 59e7134f41..2b3f021716 100644 --- a/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py +++ b/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py @@ -767,7 +767,7 @@ def test_list_instance_configs_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.ListInstanceConfigsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -785,7 +785,7 @@ def test_list_instance_configs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -799,7 +799,7 @@ async def test_list_instance_configs_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.ListInstanceConfigsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -819,7 +819,7 @@ async def test_list_instance_configs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -956,7 +956,7 @@ def test_list_instance_configs_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, spanner_instance_admin.InstanceConfig) for i in results @@ -1222,7 +1222,7 @@ def test_get_instance_config_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.GetInstanceConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1240,7 +1240,7 @@ def test_get_instance_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1254,7 +1254,7 @@ async def test_get_instance_config_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.GetInstanceConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1274,7 +1274,7 @@ async def test_get_instance_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1463,7 +1463,7 @@ def test_list_instances_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.ListInstancesRequest() - 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_instances), "__call__") as call: @@ -1479,7 +1479,7 @@ def test_list_instances_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1493,7 +1493,7 @@ async def test_list_instances_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.ListInstancesRequest() - 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_instances), "__call__") as call: @@ -1511,7 +1511,7 @@ async def test_list_instances_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1642,7 +1642,7 @@ def test_list_instances_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, spanner_instance_admin.Instance) for i in results) @@ -1908,7 +1908,7 @@ def test_get_instance_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.GetInstanceRequest() - 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_instance), "__call__") as call: @@ -1924,7 +1924,7 @@ def test_get_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1938,7 +1938,7 @@ async def test_get_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.GetInstanceRequest() - 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_instance), "__call__") as call: @@ -1956,7 +1956,7 @@ async def test_get_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2135,7 +2135,7 @@ def test_create_instance_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.CreateInstanceRequest() - 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_instance), "__call__") as call: @@ -2151,7 +2151,7 @@ def test_create_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2165,7 +2165,7 @@ async def test_create_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.CreateInstanceRequest() - 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_instance), "__call__") as call: @@ -2183,7 +2183,7 @@ async def test_create_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2382,7 +2382,7 @@ def test_update_instance_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.UpdateInstanceRequest() - request.instance.name = "instance.name/value" + request.instance.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_instance), "__call__") as call: @@ -2398,7 +2398,7 @@ def test_update_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "instance.name=instance.name/value", + "instance.name=name_value", ) in kw["metadata"] @@ -2412,7 +2412,7 @@ async def test_update_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.UpdateInstanceRequest() - request.instance.name = "instance.name/value" + request.instance.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_instance), "__call__") as call: @@ -2430,7 +2430,7 @@ async def test_update_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "instance.name=instance.name/value", + "instance.name=name_value", ) in kw["metadata"] @@ -2617,7 +2617,7 @@ def test_delete_instance_field_headers(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.DeleteInstanceRequest() - 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_instance), "__call__") as call: @@ -2633,7 +2633,7 @@ def test_delete_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2647,7 +2647,7 @@ async def test_delete_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner_instance_admin.DeleteInstanceRequest() - 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_instance), "__call__") as call: @@ -2663,7 +2663,7 @@ async def test_delete_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2849,7 +2849,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2865,7 +2865,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2879,7 +2879,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2895,7 +2895,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3099,7 +3099,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -3115,7 +3115,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3129,7 +3129,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -3145,7 +3145,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3351,7 +3351,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3369,7 +3369,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3383,7 +3383,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3403,7 +3403,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/spanner_v1/test_spanner.py b/tests/unit/gapic/spanner_v1/test_spanner.py index d4df289e48..51cdc83e14 100644 --- a/tests/unit/gapic/spanner_v1/test_spanner.py +++ b/tests/unit/gapic/spanner_v1/test_spanner.py @@ -712,7 +712,7 @@ def test_create_session_field_headers(): # a field header. Set these to a non-empty value. request = spanner.CreateSessionRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_session), "__call__") as call: @@ -728,7 +728,7 @@ def test_create_session_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -742,7 +742,7 @@ async def test_create_session_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.CreateSessionRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_session), "__call__") as call: @@ -758,7 +758,7 @@ async def test_create_session_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -940,7 +940,7 @@ def test_batch_create_sessions_field_headers(): # a field header. Set these to a non-empty value. request = spanner.BatchCreateSessionsRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -958,7 +958,7 @@ def test_batch_create_sessions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -972,7 +972,7 @@ async def test_batch_create_sessions_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.BatchCreateSessionsRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -992,7 +992,7 @@ async def test_batch_create_sessions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1190,7 +1190,7 @@ def test_get_session_field_headers(): # a field header. Set these to a non-empty value. request = spanner.GetSessionRequest() - 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_session), "__call__") as call: @@ -1206,7 +1206,7 @@ def test_get_session_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1220,7 +1220,7 @@ async def test_get_session_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.GetSessionRequest() - 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_session), "__call__") as call: @@ -1236,7 +1236,7 @@ async def test_get_session_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1418,7 +1418,7 @@ def test_list_sessions_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ListSessionsRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_sessions), "__call__") as call: @@ -1434,7 +1434,7 @@ def test_list_sessions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1448,7 +1448,7 @@ async def test_list_sessions_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ListSessionsRequest() - request.database = "database/value" + request.database = "database_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_sessions), "__call__") as call: @@ -1466,7 +1466,7 @@ async def test_list_sessions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "database=database/value", + "database=database_value", ) in kw["metadata"] @@ -1597,7 +1597,7 @@ def test_list_sessions_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, spanner.Session) for i in results) @@ -1830,7 +1830,7 @@ def test_delete_session_field_headers(): # a field header. Set these to a non-empty value. request = spanner.DeleteSessionRequest() - 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_session), "__call__") as call: @@ -1846,7 +1846,7 @@ def test_delete_session_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1860,7 +1860,7 @@ async def test_delete_session_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.DeleteSessionRequest() - 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_session), "__call__") as call: @@ -1876,7 +1876,7 @@ async def test_delete_session_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2052,7 +2052,7 @@ def test_execute_sql_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ExecuteSqlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.execute_sql), "__call__") as call: @@ -2068,7 +2068,7 @@ def test_execute_sql_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2082,7 +2082,7 @@ async def test_execute_sql_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ExecuteSqlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.execute_sql), "__call__") as call: @@ -2100,7 +2100,7 @@ async def test_execute_sql_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2205,7 +2205,7 @@ def test_execute_streaming_sql_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ExecuteSqlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2223,7 +2223,7 @@ def test_execute_streaming_sql_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2237,7 +2237,7 @@ async def test_execute_streaming_sql_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ExecuteSqlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2258,7 +2258,7 @@ async def test_execute_streaming_sql_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2360,7 +2360,7 @@ def test_execute_batch_dml_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ExecuteBatchDmlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2378,7 +2378,7 @@ def test_execute_batch_dml_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2392,7 +2392,7 @@ async def test_execute_batch_dml_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ExecuteBatchDmlRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2412,7 +2412,7 @@ async def test_execute_batch_dml_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2508,7 +2508,7 @@ def test_read_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.read), "__call__") as call: @@ -2524,7 +2524,7 @@ def test_read_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2538,7 +2538,7 @@ async def test_read_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.read), "__call__") as call: @@ -2556,7 +2556,7 @@ async def test_read_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2655,7 +2655,7 @@ def test_streaming_read_field_headers(): # a field header. Set these to a non-empty value. request = spanner.ReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.streaming_read), "__call__") as call: @@ -2671,7 +2671,7 @@ def test_streaming_read_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2685,7 +2685,7 @@ async def test_streaming_read_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.ReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.streaming_read), "__call__") as call: @@ -2704,7 +2704,7 @@ async def test_streaming_read_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2812,7 +2812,7 @@ def test_begin_transaction_field_headers(): # a field header. Set these to a non-empty value. request = spanner.BeginTransactionRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2830,7 +2830,7 @@ def test_begin_transaction_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -2844,7 +2844,7 @@ async def test_begin_transaction_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.BeginTransactionRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2864,7 +2864,7 @@ async def test_begin_transaction_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3056,7 +3056,7 @@ def test_commit_field_headers(): # a field header. Set these to a non-empty value. request = spanner.CommitRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.commit), "__call__") as call: @@ -3072,7 +3072,7 @@ def test_commit_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3086,7 +3086,7 @@ async def test_commit_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.CommitRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.commit), "__call__") as call: @@ -3104,7 +3104,7 @@ async def test_commit_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3316,7 +3316,7 @@ def test_rollback_field_headers(): # a field header. Set these to a non-empty value. request = spanner.RollbackRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.rollback), "__call__") as call: @@ -3332,7 +3332,7 @@ def test_rollback_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3346,7 +3346,7 @@ async def test_rollback_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.RollbackRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.rollback), "__call__") as call: @@ -3362,7 +3362,7 @@ async def test_rollback_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3548,7 +3548,7 @@ def test_partition_query_field_headers(): # a field header. Set these to a non-empty value. request = spanner.PartitionQueryRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.partition_query), "__call__") as call: @@ -3564,7 +3564,7 @@ def test_partition_query_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3578,7 +3578,7 @@ async def test_partition_query_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.PartitionQueryRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.partition_query), "__call__") as call: @@ -3596,7 +3596,7 @@ async def test_partition_query_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3692,7 +3692,7 @@ def test_partition_read_field_headers(): # a field header. Set these to a non-empty value. request = spanner.PartitionReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.partition_read), "__call__") as call: @@ -3708,7 +3708,7 @@ def test_partition_read_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"] @@ -3722,7 +3722,7 @@ async def test_partition_read_field_headers_async(): # a field header. Set these to a non-empty value. request = spanner.PartitionReadRequest() - request.session = "session/value" + request.session = "session_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.partition_read), "__call__") as call: @@ -3740,7 +3740,7 @@ async def test_partition_read_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "session=session/value", + "session=session_value", ) in kw["metadata"]