Skip to content

chore: Fix CI #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion decrypt_oracle/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def read(*args):
"""Read complete file contents."""
return open(os.path.join(HERE, *args)).read()
return open(os.path.join(HERE, *args)).read() # pylint: disable=consider-using-with


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def read(*args):
"""Reads complete file contents."""
return open(os.path.join(HERE, *args)).read()
return open(os.path.join(HERE, *args)).read() # pylint: disable=consider-using-with


def get_version():
Expand Down
3 changes: 2 additions & 1 deletion src/aws_encryption_sdk/internal/utils/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class TeeStream(ObjectProxy):
:type tee: io.BaseIO
"""

__tee = None # Prime ObjectProxy's attributes to allow setting in init.
# Prime ObjectProxy's attributes to allow setting in init.
__tee = None # pylint: disable=unused-private-member

def __init__(self, wrapped, tee):
"""Creates the local tee stream."""
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_kat_commitment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _file_root():
base_dir = os.path.join(root_dir, "test", "resources")
file_path = os.path.join(base_dir, FILE_NAME)

test_str = open(file_path, "r").read()
test_str = open(file_path, "r").read() # pylint: disable=consider-using-with
test_json = json.loads(test_str)
kat_tests = test_json["tests"]

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_caches_crypto_cache_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}


@pytest.yield_fixture
@pytest.fixture
def patch_time(mocker):
mocker.patch.object(aws_encryption_sdk.caches.time, "time")

Expand Down
14 changes: 7 additions & 7 deletions test/unit/test_caches_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_try_to_evict_one_entry_entry_valid():
cache._lre_deque.appendleft.assert_called_once_with(mock_reference)


@pytest.yield_fixture
@pytest.fixture
def patch_try_to_evict_one_entry(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "_try_to_evict_one_entry")
yield LocalCryptoMaterialsCache._try_to_evict_one_entry
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_prune(patch_try_to_evict_one_entry):
patch_try_to_evict_one_entry.assert_has_calls((call(), call()))


@pytest.yield_fixture
@pytest.fixture
def patch_prune(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "_prune")
yield LocalCryptoMaterialsCache._prune
Expand All @@ -183,19 +183,19 @@ def test_add_value_to_cache(patch_prune):
patch_prune.assert_called_once_with()


@pytest.yield_fixture
@pytest.fixture
def patch_try_to_evict_some_entries(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "_try_to_evict_some_entries")
yield LocalCryptoMaterialsCache._try_to_evict_some_entries


@pytest.yield_fixture
@pytest.fixture
def patch_add_value_to_cache(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "_add_value_to_cache")
yield LocalCryptoMaterialsCache._add_value_to_cache


@pytest.yield_fixture
@pytest.fixture
def patch_crypto_cache_entry(mocker):
mocker.patch.object(aws_encryption_sdk.caches.local, "CryptoMaterialsCacheEntry")
yield aws_encryption_sdk.caches.local.CryptoMaterialsCacheEntry
Expand Down Expand Up @@ -252,7 +252,7 @@ def test_remove_success():
assert sentinel.value not in cache._cache


@pytest.yield_fixture
@pytest.fixture
def patch_remove(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "remove")
yield LocalCryptoMaterialsCache.remove
Expand Down Expand Up @@ -291,7 +291,7 @@ def test_get_single_entry_cache_hit_valid():
assert test is mock_entry


@pytest.yield_fixture
@pytest.fixture
def patch_get_single_entry(mocker):
mocker.patch.object(LocalCryptoMaterialsCache, "_get_single_entry")
yield LocalCryptoMaterialsCache._get_single_entry
Expand Down
12 changes: 6 additions & 6 deletions test/unit/test_crypto_authentication_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,37 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
yield aws_encryption_sdk.internal.crypto.authentication.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_serialization(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "serialization")
yield aws_encryption_sdk.internal.crypto.authentication.serialization


@pytest.yield_fixture
@pytest.fixture
def patch_ecc_encode_compressed_point(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_encode_compressed_point")
yield aws_encryption_sdk.internal.crypto.authentication._ecc_encode_compressed_point


@pytest.yield_fixture
@pytest.fixture
def patch_ecc_static_length_signature(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_static_length_signature")
yield aws_encryption_sdk.internal.crypto.authentication._ecc_static_length_signature


@pytest.yield_fixture
@pytest.fixture
def patch_base64(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "base64")
yield aws_encryption_sdk.internal.crypto.authentication.base64


@pytest.yield_fixture
@pytest.fixture
def patch_build_hasher(mocker):
mocker.patch.object(Signer, "_build_hasher")
yield Signer._build_hasher
Expand Down
16 changes: 8 additions & 8 deletions test/unit/test_crypto_authentication_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,49 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
yield aws_encryption_sdk.internal.crypto.authentication.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_serialization(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "serialization")
yield aws_encryption_sdk.internal.crypto.authentication.serialization


@pytest.yield_fixture
@pytest.fixture
def patch_ecc_public_numbers_from_compressed_point(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_public_numbers_from_compressed_point")
yield aws_encryption_sdk.internal.crypto.authentication._ecc_public_numbers_from_compressed_point


@pytest.yield_fixture
@pytest.fixture
def patch_ec(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "ec")
yield aws_encryption_sdk.internal.crypto.authentication.ec


@pytest.yield_fixture
@pytest.fixture
def patch_prehashed(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "Prehashed")
yield aws_encryption_sdk.internal.crypto.authentication.Prehashed


@pytest.yield_fixture
@pytest.fixture
def patch_base64(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "base64")
yield aws_encryption_sdk.internal.crypto.authentication.base64


@pytest.yield_fixture
@pytest.fixture
def patch_build_hasher(mocker):
mocker.patch.object(Verifier, "_build_hasher")
yield Verifier._build_hasher


@pytest.yield_fixture
@pytest.fixture
def patch_set_signature_type(mocker):
mocker.patch.object(Verifier, "_set_signature_type")
yield Verifier._set_signature_type
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_crypto_data_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
from mock import MagicMock, sentinel
from pytest_mock import mocker # noqa pylint: disable=unused-import

import aws_encryption_sdk.internal.crypto.data_keys as data_keys
from aws_encryption_sdk.internal.crypto import data_keys

pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(data_keys, "default_backend")
yield data_keys.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_struct(mocker):
mocker.patch.object(data_keys, "struct")
yield data_keys.struct
Expand Down
18 changes: 9 additions & 9 deletions test/unit/test_crypto_elliptic_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,55 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "default_backend")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_ec(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "ec")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.ec


@pytest.yield_fixture
@pytest.fixture
def patch_pow(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "pow")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.pow


@pytest.yield_fixture
@pytest.fixture
def patch_encode_dss_signature(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "encode_dss_signature")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.encode_dss_signature


@pytest.yield_fixture
@pytest.fixture
def patch_decode_dss_signature(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "decode_dss_signature")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.decode_dss_signature


@pytest.yield_fixture
@pytest.fixture
def patch_ecc_decode_compressed_point(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "_ecc_decode_compressed_point")
yield aws_encryption_sdk.internal.crypto.elliptic_curve._ecc_decode_compressed_point


@pytest.yield_fixture
@pytest.fixture
def patch_verify_interface(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "verify_interface")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.verify_interface


@pytest.yield_fixture
@pytest.fixture
def patch_ecc_curve_parameters(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "_ECC_CURVE_PARAMETERS")
yield aws_encryption_sdk.internal.crypto.elliptic_curve._ECC_CURVE_PARAMETERS


@pytest.yield_fixture
@pytest.fixture
def patch_prehashed(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "Prehashed")
yield aws_encryption_sdk.internal.crypto.elliptic_curve.Prehashed
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_crypto_encryption_decryptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "default_backend")
yield aws_encryption_sdk.internal.crypto.encryption.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_cipher(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Cipher")
yield aws_encryption_sdk.internal.crypto.encryption.Cipher


@pytest.yield_fixture
@pytest.fixture
def patch_decryptor(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Decryptor")
yield aws_encryption_sdk.internal.crypto.encryption.Decryptor
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_crypto_encryption_encryptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "default_backend")
yield aws_encryption_sdk.internal.crypto.encryption.default_backend


@pytest.yield_fixture
@pytest.fixture
def patch_cipher(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Cipher")
yield aws_encryption_sdk.internal.crypto.encryption.Cipher


@pytest.yield_fixture
@pytest.fixture
def patch_encryptor(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Encryptor")
yield aws_encryption_sdk.internal.crypto.encryption.Encryptor
Expand Down
12 changes: 6 additions & 6 deletions test/unit/test_crypto_prehashing_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@
pytestmark = [pytest.mark.unit, pytest.mark.local]


@pytest.yield_fixture
@pytest.fixture
def patch_set_signature_type(mocker):
mocker.patch.object(_PrehashingAuthenticator, "_set_signature_type")
yield _PrehashingAuthenticator._set_signature_type


@pytest.yield_fixture
@pytest.fixture
def patch_build_hasher(mocker):
mocker.patch.object(_PrehashingAuthenticator, "_build_hasher")
yield _PrehashingAuthenticator._build_hasher


@pytest.yield_fixture
@pytest.fixture
def patch_cryptography_utils_verify_interface(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "verify_interface")
yield aws_encryption_sdk.internal.crypto.authentication.verify_interface


@pytest.yield_fixture
@pytest.fixture
def patch_cryptography_ec(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "ec")
yield aws_encryption_sdk.internal.crypto.authentication.ec


@pytest.yield_fixture
@pytest.fixture
def patch_cryptography_hashes(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "hashes")
yield aws_encryption_sdk.internal.crypto.authentication.hashes


@pytest.yield_fixture
@pytest.fixture
def patch_cryptography_default_backend(mocker):
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
yield aws_encryption_sdk.internal.crypto.authentication.default_backend
Expand Down
Loading