@@ -55,7 +55,7 @@ def create_legacy_encrypted_client(attribute_actions=None, expect_standard_dicti
5555 """Create a legacy DynamoDB encrypted client."""
5656 cmp = AwsKmsCryptographicMaterialsProvider (key_id = INTEG_TEST_DEFAULT_KMS_KEY_ID )
5757 return LegacyEncryptedClient (
58- client = boto3 . client ( "dynamodb" ),
58+ client = plaintext_client ( expect_standard_dictionaries ),
5959 materials_provider = cmp ,
6060 attribute_actions = attribute_actions ,
6161 expect_standard_dictionaries = expect_standard_dictionaries ,
@@ -124,6 +124,14 @@ def create_encryption_config(legacy_encryptor=None, legacy_policy=None):
124124 return DynamoDbTablesEncryptionConfig (table_encryption_configs = table_configs )
125125
126126
127+ def plaintext_client (expect_standard_dictionaries ):
128+ if expect_standard_dictionaries :
129+ client = boto3 .resource ("dynamodb" ).Table (INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME ).meta .client
130+ else :
131+ client = boto3 .client ("dynamodb" )
132+ return client
133+
134+
127135def encrypted_client_with_legacy_override (
128136 legacy_encryptor = None , legacy_policy = None , expect_standard_dictionaries = False
129137):
@@ -132,7 +140,7 @@ def encrypted_client_with_legacy_override(
132140
133141 # Create the EncryptedClient
134142 return EncryptedClient (
135- client = boto3 . client ( "dynamodb" ),
143+ client = plaintext_client ( expect_standard_dictionaries ),
136144 encryption_config = tables_config ,
137145 expect_standard_dictionaries = expect_standard_dictionaries ,
138146 )
@@ -159,17 +167,3 @@ def encrypted_resource_with_legacy_override(legacy_encryptor=None, legacy_policy
159167 resource = boto3 .resource ("dynamodb" ),
160168 encryption_config = tables_config ,
161169 )
162-
163-
164- def cleanup_ddb_items (items ):
165- """Delete DynamoDB items from the test table."""
166- client = boto3 .client ("dynamodb" )
167- for item in items :
168- try :
169- client .delete_item (
170- TableName = INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME ,
171- Key = {"partition_key" : item ["partition_key" ], "sort_key" : item ["sort_key" ]},
172- )
173- except Exception :
174- # Ignore errors on cleanup
175- pass
0 commit comments