@@ -168,24 +168,24 @@ def test_init_spawn_args(self):
168168 @unittest .skipUnless (_HAVE_PYMONGOCRYPT , "pymongocrypt is not installed" )
169169 def test_init_kms_tls_options (self ):
170170 # Error cases:
171+ opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
171172 with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
172- opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
173- _parse_kms_tls_options (opts ._kms_tls_options , _IS_SYNC )
173+ self .async_rs_or_single_client (auto_encryption_opts = opts )
174174
175175 tls_opts : Any
176176 for tls_opts in [
177177 {"kmip" : {"tls" : True , "tlsInsecure" : True }},
178178 {"kmip" : {"tls" : True , "tlsAllowInvalidCertificates" : True }},
179179 {"kmip" : {"tls" : True , "tlsAllowInvalidHostnames" : True }},
180180 ]:
181+ opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
181182 with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
182- opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
183- _parse_kms_tls_options (opts ._kms_tls_options , _IS_SYNC )
183+ self .async_rs_or_single_client (auto_encryption_opts = opts )
184+ opts = AutoEncryptionOpts (
185+ {}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
186+ )
184187 with self .assertRaises (FileNotFoundError ):
185- opts = AutoEncryptionOpts (
186- {}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
187- )
188- _parse_kms_tls_options (opts ._kms_tls_options , _IS_SYNC )
188+ self .async_rs_or_single_client (auto_encryption_opts = opts )
189189 # Success cases:
190190 tls_opts : Any
191191 for tls_opts in [None , {}]:
0 commit comments