@@ -318,6 +318,17 @@ def test_encryption_config(self):
318318 )
319319 self .assertEqual (database .encryption_config , encryption_config )
320320
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+
321332 def test_spanner_api_property_w_scopeless_creds (self ):
322333
323334 client = _Client ()
@@ -682,6 +693,7 @@ def test_reload_not_found(self):
682693 def test_reload_success (self ):
683694 from google .cloud .spanner_admin_database_v1 import Database
684695 from google .cloud .spanner_admin_database_v1 import EncryptionConfig
696+ from google .cloud .spanner_admin_database_v1 import EncryptionInfo
685697 from google .cloud .spanner_admin_database_v1 import GetDatabaseDdlResponse
686698 from google .cloud .spanner_admin_database_v1 import RestoreInfo
687699 from google .cloud ._helpers import _datetime_to_pb_timestamp
@@ -693,6 +705,12 @@ def test_reload_success(self):
693705 client = _Client ()
694706 ddl_pb = GetDatabaseDdlResponse (statements = DDL_STATEMENTS )
695707 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+ ]
696714 api = client .database_admin_api = self ._make_database_admin_api ()
697715 api .get_database_ddl .return_value = ddl_pb
698716 db_pb = Database (
@@ -702,6 +720,7 @@ def test_reload_success(self):
702720 version_retention_period = "1d" ,
703721 earliest_version_time = _datetime_to_pb_timestamp (timestamp ),
704722 encryption_config = encryption_config ,
723+ encryption_info = encryption_info ,
705724 )
706725 api .get_database .return_value = db_pb
707726 instance = _Instance (self .INSTANCE_NAME , client = client )
@@ -716,6 +735,7 @@ def test_reload_success(self):
716735 self .assertEqual (database ._earliest_version_time , timestamp )
717736 self .assertEqual (database ._ddl_statements , tuple (DDL_STATEMENTS ))
718737 self .assertEqual (database ._encryption_config , encryption_config )
738+ self .assertEqual (database ._encryption_info , encryption_info )
719739
720740 api .get_database_ddl .assert_called_once_with (
721741 database = self .DATABASE_NAME ,
0 commit comments