Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
felipao-mx committed May 31, 2024
1 parent 43f8ddb commit 88176ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion mongoengine_plus/types/encrypted_string/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__all__ = ['EncryptedString', 'patch_kms_request']

import codecs
import os

import boto3
from pymongo.encryption import _EncryptionIO
Expand Down
10 changes: 6 additions & 4 deletions tests/types/test_encrypted_string.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from functools import partial
from typing import Generator
from unittest.mock import patch

import pytest
Expand Down Expand Up @@ -29,7 +30,7 @@ class User(Document):


@pytest.fixture
def user() -> User:
def user() -> Generator[User, None, None]:
user = User(name='Frida Kahlo', nss='123456')
user.save()
yield user
Expand Down Expand Up @@ -134,9 +135,10 @@ def test_patch_kms_request(kms_connection_url: str) -> None:
original_kms_request = _EncryptionIO.kms_request
import boto3

# Since we're using a self-signed certificate with the moto_server for testing,
# we need to patch boto3.client to disable certificate verification.
# This is a workaround and should not be done in production environments.
# Since we're using a self-signed certificate with the moto_server
# for testing, we need to patch boto3.client to disable
# certificate verification. This is a workaround and should not be done
# in production environments.
with patch('boto3.client', partial(boto3.client, verify=False)):
patch_kms_request(
EncryptedString.key_namespace,
Expand Down

0 comments on commit 88176ab

Please sign in to comment.