@@ -697,6 +697,7 @@ def test_list_backups_w_options(self):
697697 )
698698
699699 def test_list_backup_operations_defaults (self ):
700+ from google .api_core .operation import Operation
700701 from google .cloud .spanner_admin_database_v1 import CreateBackupMetadata
701702 from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
702703 from google .cloud .spanner_admin_database_v1 import ListBackupOperationsRequest
@@ -726,7 +727,7 @@ def test_list_backup_operations_defaults(self):
726727 api ._transport .list_backup_operations
727728 ] = mock .Mock (return_value = operations_pb )
728729
729- instance .list_backup_operations ()
730+ ops = instance .list_backup_operations ()
730731
731732 expected_metadata = (
732733 ("google-cloud-resource-prefix" , instance .name ),
@@ -738,8 +739,10 @@ def test_list_backup_operations_defaults(self):
738739 retry = mock .ANY ,
739740 timeout = mock .ANY ,
740741 )
742+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
741743
742744 def test_list_backup_operations_w_options (self ):
745+ from google .api_core .operation import Operation
743746 from google .cloud .spanner_admin_database_v1 import CreateBackupMetadata
744747 from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
745748 from google .cloud .spanner_admin_database_v1 import ListBackupOperationsRequest
@@ -769,7 +772,7 @@ def test_list_backup_operations_w_options(self):
769772 api ._transport .list_backup_operations
770773 ] = mock .Mock (return_value = operations_pb )
771774
772- instance .list_backup_operations (filter_ = "filter" , page_size = 10 )
775+ ops = instance .list_backup_operations (filter_ = "filter" , page_size = 10 )
773776
774777 expected_metadata = (
775778 ("google-cloud-resource-prefix" , instance .name ),
@@ -783,8 +786,10 @@ def test_list_backup_operations_w_options(self):
783786 retry = mock .ANY ,
784787 timeout = mock .ANY ,
785788 )
789+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
786790
787791 def test_list_database_operations_defaults (self ):
792+ from google .api_core .operation import Operation
788793 from google .cloud .spanner_admin_database_v1 import CreateDatabaseMetadata
789794 from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
790795 from google .cloud .spanner_admin_database_v1 import ListDatabaseOperationsRequest
@@ -827,7 +832,7 @@ def test_list_database_operations_defaults(self):
827832 api ._transport .list_database_operations
828833 ] = mock .Mock (return_value = databases_pb )
829834
830- instance .list_database_operations ()
835+ ops = instance .list_database_operations ()
831836
832837 expected_metadata = (
833838 ("google-cloud-resource-prefix" , instance .name ),
@@ -839,8 +844,10 @@ def test_list_database_operations_defaults(self):
839844 retry = mock .ANY ,
840845 timeout = mock .ANY ,
841846 )
847+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
842848
843849 def test_list_database_operations_w_options (self ):
850+ from google .api_core .operation import Operation
844851 from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
845852 from google .cloud .spanner_admin_database_v1 import ListDatabaseOperationsRequest
846853 from google .cloud .spanner_admin_database_v1 import (
@@ -888,7 +895,7 @@ def test_list_database_operations_w_options(self):
888895 api ._transport .list_database_operations
889896 ] = mock .Mock (return_value = databases_pb )
890897
891- instance .list_database_operations (filter_ = "filter" , page_size = 10 )
898+ ops = instance .list_database_operations (filter_ = "filter" , page_size = 10 )
892899
893900 expected_metadata = (
894901 ("google-cloud-resource-prefix" , instance .name ),
@@ -902,6 +909,7 @@ def test_list_database_operations_w_options(self):
902909 retry = mock .ANY ,
903910 timeout = mock .ANY ,
904911 )
912+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
905913
906914 def test_type_string_to_type_pb_hit (self ):
907915 from google .cloud .spanner_admin_database_v1 import (
0 commit comments