Skip to content

Commit 05c061a

Browse files
committed
fix test failures
1 parent d007c5f commit 05c061a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/asynchronous/test_encryption.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_init(self):
142142
self.assertEqual(opts._mongocryptd_bypass_spawn, False)
143143
self.assertEqual(opts._mongocryptd_spawn_path, "mongocryptd")
144144
self.assertEqual(opts._mongocryptd_spawn_args, ["--idleShutdownTimeoutSecs=60"])
145-
self.assertEqual(opts._kms_tls_options, {})
145+
self.assertEqual(opts._kms_tls_options, None)
146146

147147
@unittest.skipUnless(_HAVE_PYMONGOCRYPT, "pymongocrypt is not installed")
148148
def test_init_spawn_args(self):
@@ -170,7 +170,7 @@ def test_init_kms_tls_options(self):
170170
# Error cases:
171171
with self.assertRaisesRegex(TypeError, r'kms_tls_options\["kmip"\] must be a dict'):
172172
opts = AutoEncryptionOpts({}, "k.d", kms_tls_options={"kmip": 1})
173-
opts._parse_kms_tls_options(_IS_SYNC)
173+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
174174

175175
tls_opts: Any
176176
for tls_opts in [
@@ -180,12 +180,12 @@ def test_init_kms_tls_options(self):
180180
]:
181181
with self.assertRaisesRegex(ConfigurationError, "Insecure TLS options prohibited"):
182182
opts = AutoEncryptionOpts({}, "k.d", kms_tls_options=tls_opts)
183-
opts._parse_kms_tls_options(_IS_SYNC)
183+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
184184
with self.assertRaises(FileNotFoundError):
185185
opts = AutoEncryptionOpts(
186186
{}, "k.d", kms_tls_options={"kmip": {"tlsCAFile": "does-not-exist"}}
187187
)
188-
opts._parse_kms_tls_options(_IS_SYNC)
188+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
189189
# Success cases:
190190
tls_opts: Any
191191
for tls_opts in [None, {}]:

test/test_encryption.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_init(self):
142142
self.assertEqual(opts._mongocryptd_bypass_spawn, False)
143143
self.assertEqual(opts._mongocryptd_spawn_path, "mongocryptd")
144144
self.assertEqual(opts._mongocryptd_spawn_args, ["--idleShutdownTimeoutSecs=60"])
145-
self.assertEqual(opts._kms_tls_options, {})
145+
self.assertEqual(opts._kms_tls_options, None)
146146

147147
@unittest.skipUnless(_HAVE_PYMONGOCRYPT, "pymongocrypt is not installed")
148148
def test_init_spawn_args(self):
@@ -170,7 +170,7 @@ def test_init_kms_tls_options(self):
170170
# Error cases:
171171
with self.assertRaisesRegex(TypeError, r'kms_tls_options\["kmip"\] must be a dict'):
172172
opts = AutoEncryptionOpts({}, "k.d", kms_tls_options={"kmip": 1})
173-
opts._parse_kms_tls_options(_IS_SYNC)
173+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
174174

175175
tls_opts: Any
176176
for tls_opts in [
@@ -180,12 +180,12 @@ def test_init_kms_tls_options(self):
180180
]:
181181
with self.assertRaisesRegex(ConfigurationError, "Insecure TLS options prohibited"):
182182
opts = AutoEncryptionOpts({}, "k.d", kms_tls_options=tls_opts)
183-
opts._parse_kms_tls_options(_IS_SYNC)
183+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
184184
with self.assertRaises(FileNotFoundError):
185185
opts = AutoEncryptionOpts(
186186
{}, "k.d", kms_tls_options={"kmip": {"tlsCAFile": "does-not-exist"}}
187187
)
188-
opts._parse_kms_tls_options(_IS_SYNC)
188+
_parse_kms_tls_options(opts._kms_tls_options, _IS_SYNC)
189189
# Success cases:
190190
tls_opts: Any
191191
for tls_opts in [None, {}]:

0 commit comments

Comments
 (0)