@@ -318,6 +318,17 @@ def test_encryption_config(self):
318
318
)
319
319
self .assertEqual (database .encryption_config , encryption_config )
320
320
321
+ def test_encryption_info (self ):
322
+ from google .cloud .spanner_admin_database_v1 import EncryptionInfo
323
+
324
+ instance = _Instance (self .INSTANCE_NAME )
325
+ pool = _Pool ()
326
+ database = self ._make_one (self .DATABASE_ID , instance , pool = pool )
327
+ encryption_info = database ._encryption_info = [
328
+ mock .create_autospec (EncryptionInfo , instance = True )
329
+ ]
330
+ self .assertEqual (database .encryption_info , encryption_info )
331
+
321
332
def test_spanner_api_property_w_scopeless_creds (self ):
322
333
323
334
client = _Client ()
@@ -682,6 +693,7 @@ def test_reload_not_found(self):
682
693
def test_reload_success (self ):
683
694
from google .cloud .spanner_admin_database_v1 import Database
684
695
from google .cloud .spanner_admin_database_v1 import EncryptionConfig
696
+ from google .cloud .spanner_admin_database_v1 import EncryptionInfo
685
697
from google .cloud .spanner_admin_database_v1 import GetDatabaseDdlResponse
686
698
from google .cloud .spanner_admin_database_v1 import RestoreInfo
687
699
from google .cloud ._helpers import _datetime_to_pb_timestamp
@@ -693,6 +705,12 @@ def test_reload_success(self):
693
705
client = _Client ()
694
706
ddl_pb = GetDatabaseDdlResponse (statements = DDL_STATEMENTS )
695
707
encryption_config = EncryptionConfig (kms_key_name = "kms_key" )
708
+ encryption_info = [
709
+ EncryptionInfo (
710
+ encryption_type = EncryptionInfo .Type .CUSTOMER_MANAGED_ENCRYPTION ,
711
+ kms_key_version = "kms_key_version" ,
712
+ )
713
+ ]
696
714
api = client .database_admin_api = self ._make_database_admin_api ()
697
715
api .get_database_ddl .return_value = ddl_pb
698
716
db_pb = Database (
@@ -702,6 +720,7 @@ def test_reload_success(self):
702
720
version_retention_period = "1d" ,
703
721
earliest_version_time = _datetime_to_pb_timestamp (timestamp ),
704
722
encryption_config = encryption_config ,
723
+ encryption_info = encryption_info ,
705
724
)
706
725
api .get_database .return_value = db_pb
707
726
instance = _Instance (self .INSTANCE_NAME , client = client )
@@ -716,6 +735,7 @@ def test_reload_success(self):
716
735
self .assertEqual (database ._earliest_version_time , timestamp )
717
736
self .assertEqual (database ._ddl_statements , tuple (DDL_STATEMENTS ))
718
737
self .assertEqual (database ._encryption_config , encryption_config )
738
+ self .assertEqual (database ._encryption_info , encryption_info )
719
739
720
740
api .get_database_ddl .assert_called_once_with (
721
741
database = self .DATABASE_NAME ,
0 commit comments