@@ -168,24 +168,24 @@ def test_init_spawn_args(self):
168
168
@unittest .skipUnless (_HAVE_PYMONGOCRYPT , "pymongocrypt is not installed" )
169
169
def test_init_kms_tls_options (self ):
170
170
# Error cases:
171
+ opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
171
172
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 )
174
174
175
175
tls_opts : Any
176
176
for tls_opts in [
177
177
{"kmip" : {"tls" : True , "tlsInsecure" : True }},
178
178
{"kmip" : {"tls" : True , "tlsAllowInvalidCertificates" : True }},
179
179
{"kmip" : {"tls" : True , "tlsAllowInvalidHostnames" : True }},
180
180
]:
181
+ opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
181
182
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
+ )
184
187
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 )
189
189
# Success cases:
190
190
tls_opts : Any
191
191
for tls_opts in [None , {}]:
0 commit comments