@@ -667,6 +667,7 @@ def _make_resource(self):
667
667
"location" : "US" ,
668
668
"selfLink" : self .RESOURCE_URL ,
669
669
"defaultTableExpirationMs" : 3600 ,
670
+ "storageBillingModel" : "LOGICAL" ,
670
671
"access" : [
671
672
{"role" : "OWNER" , "userByEmail" : USER_EMAIL },
672
673
{"role" : "OWNER" , "groupByEmail" : GROUP_EMAIL },
@@ -736,7 +737,12 @@ def _verify_resource_properties(self, dataset, resource):
736
737
)
737
738
else :
738
739
self .assertIsNone (dataset .default_encryption_configuration )
739
-
740
+ if "storageBillingModel" in resource :
741
+ self .assertEqual (
742
+ dataset .storage_billing_model , resource .get ("storageBillingModel" )
743
+ )
744
+ else :
745
+ self .assertIsNone (dataset .storage_billing_model )
740
746
if "access" in resource :
741
747
self ._verify_access_entry (dataset .access_entries , resource )
742
748
else :
@@ -941,6 +947,23 @@ def test_default_encryption_configuration_setter(self):
941
947
dataset .default_encryption_configuration = None
942
948
self .assertIsNone (dataset .default_encryption_configuration )
943
949
950
+ def test_storage_billing_model_setter (self ):
951
+ dataset = self ._make_one (self .DS_REF )
952
+ dataset .storage_billing_model = "PHYSICAL"
953
+ self .assertEqual (dataset .storage_billing_model , "PHYSICAL" )
954
+
955
+ def test_storage_billing_model_setter_with_none (self ):
956
+ dataset = self ._make_one (self .DS_REF )
957
+ dataset .storage_billing_model = None
958
+ self .assertEqual (dataset .storage_billing_model , "LOGICAL" )
959
+
960
+ def test_storage_billing_model_setter_with_invalid_type (self ):
961
+ dataset = self ._make_one (self .DS_REF )
962
+ with self .assertRaises (ValueError ) as raises :
963
+ dataset .storage_billing_model = object ()
964
+
965
+ self .assertIn ("storage_billing_model" , str (raises .exception ))
966
+
944
967
def test_from_string (self ):
945
968
cls = self ._get_target_class ()
946
969
got = cls .from_string ("string-project.string_dataset" )
0 commit comments