Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/asynchronous/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from pymongo.asynchronous.collection import AsyncCollection
from pymongo.asynchronous.helpers import anext
from pymongo.daemon import _spawn_daemon
from pymongo.pyopenssl_context import IS_PYOPENSSL

sys.path[0:0] = [""]

Expand Down Expand Up @@ -2860,6 +2861,7 @@ class TestKmsRetryProse(AsyncEncryptionIntegrationTest):
@unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set")
async def asyncSetUp(self):
await super().asyncSetUp()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintentional whitespace?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

# 1, create client with only tlsCAFile.
providers: dict = copy.deepcopy(ALL_KMS_PROVIDERS)
providers["azure"]["identityPlatformEndpoint"] = "127.0.0.1:9003"
Expand Down Expand Up @@ -2921,6 +2923,10 @@ async def _test(self, provider, master_key):
await self.client_encryption.create_data_key(provider, master_key=master_key)

async def test_kms_retry(self):
if IS_PYOPENSSL:
self.skipTest(
"PyOpenSSL does not support a required method for this test, Connection.makefile"
)
await self._test("aws", {"region": "foo", "key": "bar", "endpoint": "127.0.0.1:9003"})
await self._test("azure", {"keyVaultEndpoint": "127.0.0.1:9003", "keyName": "foo"})
await self._test(
Expand Down
6 changes: 6 additions & 0 deletions test/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import pytest

from pymongo.daemon import _spawn_daemon
from pymongo.pyopenssl_context import IS_PYOPENSSL
from pymongo.synchronous.collection import Collection
from pymongo.synchronous.helpers import next

Expand Down Expand Up @@ -2842,6 +2843,7 @@ class TestKmsRetryProse(EncryptionIntegrationTest):
@unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set")
def setUp(self):
super().setUp()

# 1, create client with only tlsCAFile.
providers: dict = copy.deepcopy(ALL_KMS_PROVIDERS)
providers["azure"]["identityPlatformEndpoint"] = "127.0.0.1:9003"
Expand Down Expand Up @@ -2903,6 +2905,10 @@ def _test(self, provider, master_key):
self.client_encryption.create_data_key(provider, master_key=master_key)

def test_kms_retry(self):
if IS_PYOPENSSL:
self.skipTest(
"PyOpenSSL does not support a required method for this test, Connection.makefile"
)
self._test("aws", {"region": "foo", "key": "bar", "endpoint": "127.0.0.1:9003"})
self._test("azure", {"keyVaultEndpoint": "127.0.0.1:9003", "keyName": "foo"})
self._test(
Expand Down
Loading