@@ -697,6 +697,7 @@ def test_list_backups_w_options(self):
697
697
)
698
698
699
699
def test_list_backup_operations_defaults (self ):
700
+ from google .api_core .operation import Operation
700
701
from google .cloud .spanner_admin_database_v1 import CreateBackupMetadata
701
702
from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
702
703
from google .cloud .spanner_admin_database_v1 import ListBackupOperationsRequest
@@ -726,7 +727,7 @@ def test_list_backup_operations_defaults(self):
726
727
api ._transport .list_backup_operations
727
728
] = mock .Mock (return_value = operations_pb )
728
729
729
- instance .list_backup_operations ()
730
+ ops = instance .list_backup_operations ()
730
731
731
732
expected_metadata = (
732
733
("google-cloud-resource-prefix" , instance .name ),
@@ -738,8 +739,10 @@ def test_list_backup_operations_defaults(self):
738
739
retry = mock .ANY ,
739
740
timeout = mock .ANY ,
740
741
)
742
+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
741
743
742
744
def test_list_backup_operations_w_options (self ):
745
+ from google .api_core .operation import Operation
743
746
from google .cloud .spanner_admin_database_v1 import CreateBackupMetadata
744
747
from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
745
748
from google .cloud .spanner_admin_database_v1 import ListBackupOperationsRequest
@@ -769,7 +772,7 @@ def test_list_backup_operations_w_options(self):
769
772
api ._transport .list_backup_operations
770
773
] = mock .Mock (return_value = operations_pb )
771
774
772
- instance .list_backup_operations (filter_ = "filter" , page_size = 10 )
775
+ ops = instance .list_backup_operations (filter_ = "filter" , page_size = 10 )
773
776
774
777
expected_metadata = (
775
778
("google-cloud-resource-prefix" , instance .name ),
@@ -783,8 +786,10 @@ def test_list_backup_operations_w_options(self):
783
786
retry = mock .ANY ,
784
787
timeout = mock .ANY ,
785
788
)
789
+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
786
790
787
791
def test_list_database_operations_defaults (self ):
792
+ from google .api_core .operation import Operation
788
793
from google .cloud .spanner_admin_database_v1 import CreateDatabaseMetadata
789
794
from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
790
795
from google .cloud .spanner_admin_database_v1 import ListDatabaseOperationsRequest
@@ -827,7 +832,7 @@ def test_list_database_operations_defaults(self):
827
832
api ._transport .list_database_operations
828
833
] = mock .Mock (return_value = databases_pb )
829
834
830
- instance .list_database_operations ()
835
+ ops = instance .list_database_operations ()
831
836
832
837
expected_metadata = (
833
838
("google-cloud-resource-prefix" , instance .name ),
@@ -839,8 +844,10 @@ def test_list_database_operations_defaults(self):
839
844
retry = mock .ANY ,
840
845
timeout = mock .ANY ,
841
846
)
847
+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
842
848
843
849
def test_list_database_operations_w_options (self ):
850
+ from google .api_core .operation import Operation
844
851
from google .cloud .spanner_admin_database_v1 import DatabaseAdminClient
845
852
from google .cloud .spanner_admin_database_v1 import ListDatabaseOperationsRequest
846
853
from google .cloud .spanner_admin_database_v1 import (
@@ -888,7 +895,7 @@ def test_list_database_operations_w_options(self):
888
895
api ._transport .list_database_operations
889
896
] = mock .Mock (return_value = databases_pb )
890
897
891
- instance .list_database_operations (filter_ = "filter" , page_size = 10 )
898
+ ops = instance .list_database_operations (filter_ = "filter" , page_size = 10 )
892
899
893
900
expected_metadata = (
894
901
("google-cloud-resource-prefix" , instance .name ),
@@ -902,6 +909,7 @@ def test_list_database_operations_w_options(self):
902
909
retry = mock .ANY ,
903
910
timeout = mock .ANY ,
904
911
)
912
+ self .assertTrue (all ([type (op ) == Operation for op in ops ]))
905
913
906
914
def test_type_string_to_type_pb_hit (self ):
907
915
from google .cloud .spanner_admin_database_v1 import (
0 commit comments