@@ -657,6 +657,13 @@ def tearDown(self):
657
657
for table in self .tables_to_delete :
658
658
table .delete ()
659
659
660
+ def _skip_if_emulated (self , message ):
661
+ # NOTE: This method is necessary because ``Config.IN_EMULATOR``
662
+ # is set at runtime rather than import time, which means we
663
+ # can't use the @unittest.skipIf decorator.
664
+ if Config .IN_EMULATOR :
665
+ self .skipTest (message )
666
+
660
667
def test_list_tables (self ):
661
668
# Since `Config.INSTANCE_DATA` is newly created in `setUpModule`, the
662
669
# table created in `setUpClass` here will be the only one.
@@ -691,6 +698,7 @@ def test_create_table(self):
691
698
self .assertEqual (sorted_tables , expected_tables )
692
699
693
700
def test_test_iam_permissions (self ):
701
+ self ._skip_if_emulated ("Method not implemented in bigtable emulator" )
694
702
temp_table_id = "test-test-iam-policy-table"
695
703
temp_table = Config .INSTANCE_DATA .table (temp_table_id )
696
704
temp_table .create ()
@@ -701,6 +709,7 @@ def test_test_iam_permissions(self):
701
709
self .assertEqual (permissions , permissions_allowed )
702
710
703
711
def test_get_iam_policy (self ):
712
+ self ._skip_if_emulated ("Method not implemented in bigtable emulator" )
704
713
temp_table_id = "test-get-iam-policy-table"
705
714
temp_table = Config .INSTANCE_DATA .table (temp_table_id )
706
715
temp_table .create ()
@@ -711,6 +720,7 @@ def test_get_iam_policy(self):
711
720
self .assertEqual (policy ["version" ], 0 )
712
721
713
722
def test_set_iam_policy (self ):
723
+ self ._skip_if_emulated ("Method not implemented in bigtable emulator" )
714
724
temp_table_id = "test-set-iam-policy-table"
715
725
temp_table = Config .INSTANCE_DATA .table (temp_table_id )
716
726
temp_table .create ()
@@ -742,6 +752,7 @@ def test_create_table_with_families(self):
742
752
self .assertEqual (retrieved_col_fam .gc_rule , gc_rule )
743
753
744
754
def test_create_table_with_split_keys (self ):
755
+ self ._skip_if_emulated ("Split keys are not supported by Bigtable emulator" )
745
756
temp_table_id = "foo-bar-baz-split-table"
746
757
initial_split_keys = [b"split_key_1" , b"split_key_10" , b"split_key_20" ]
747
758
temp_table = Config .INSTANCE_DATA .table (temp_table_id )
@@ -1014,6 +1025,9 @@ def test_yield_rows_with_row_set(self):
1014
1025
self .assertEqual (found_row_keys , expected_row_keys )
1015
1026
1016
1027
def test_read_large_cell_limit (self ):
1028
+ self ._maybe_emulator_skip (
1029
+ "Maximum gRPC received message size for emulator is 4194304 bytes."
1030
+ )
1017
1031
row = self ._table .row (ROW_KEY )
1018
1032
self .rows_to_delete .append (row )
1019
1033
0 commit comments