@@ -166,11 +166,12 @@ def test_init_spawn_args(self):
166166 )
167167
168168 @unittest .skipUnless (_HAVE_PYMONGOCRYPT , "pymongocrypt is not installed" )
169- def test_init_kms_tls_options (self ):
169+ async def test_init_kms_tls_options (self ):
170170 # Error cases:
171171 opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
172172 with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
173- self .async_rs_or_single_client (auto_encryption_opts = opts )
173+ client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
174+ await client .db .coll .insert_one ({"encrypted" : "test" })
174175
175176 tls_opts : Any
176177 for tls_opts in [
@@ -180,12 +181,14 @@ def test_init_kms_tls_options(self):
180181 ]:
181182 opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
182183 with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
183- self .async_rs_or_single_client (auto_encryption_opts = opts )
184+ client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
185+ await client .db .coll .insert_one ({"encrypted" : "test" })
184186 opts = AutoEncryptionOpts (
185187 {}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
186188 )
187189 with self .assertRaises (FileNotFoundError ):
188- self .async_rs_or_single_client (auto_encryption_opts = opts )
190+ client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
191+ await client .db .coll .insert_one ({"encrypted" : "test" })
189192 # Success cases:
190193 tls_opts : Any
191194 for tls_opts in [None , {}]:
0 commit comments