@@ -170,8 +170,7 @@ async def test_init_kms_tls_options(self):
170
170
# Error cases:
171
171
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
172
172
with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
173
- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
174
- await client .db .coll .insert_one ({"encrypted" : "test" })
173
+ AsyncMongoClient (auto_encryption_opts = opts )
175
174
176
175
tls_opts : Any
177
176
for tls_opts in [
@@ -181,14 +180,12 @@ async def test_init_kms_tls_options(self):
181
180
]:
182
181
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
183
182
with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
184
- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
185
- await client .db .coll .insert_one ({"encrypted" : "test" })
183
+ AsyncMongoClient (auto_encryption_opts = opts )
186
184
opts = AutoEncryptionOpts (
187
185
{}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
188
186
)
189
187
with self .assertRaises (FileNotFoundError ):
190
- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
191
- await client .db .coll .insert_one ({"encrypted" : "test" })
188
+ AsyncMongoClient (auto_encryption_opts = opts )
192
189
# Success cases:
193
190
tls_opts : Any
194
191
for tls_opts in [None , {}]:
0 commit comments