Skip to content

Commit 6409f85

Browse files
committed
linting fixes
1 parent 0eaab4a commit 6409f85

13 files changed

+8
-15
lines changed

src/aws_encryption_sdk/internal/formatting/deserialize.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
"""Components for handling AWS Encryption SDK message deserialization."""
1414
from __future__ import division
15+
1516
import io
1617
import logging
1718
import struct

src/aws_encryption_sdk/streaming_client.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
"""High level AWS Encryption SDK client for streaming objects."""
1414
from __future__ import division
15+
1516
import abc
1617
import io
1718
import logging

test/functional/test_f_xcompat.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Functional test suite testing decryption of known good test files encrypted using static RawMasterKeyProvider."""
14-
from __future__ import print_function
1514
import base64
1615
from collections import defaultdict
1716
import json
@@ -78,7 +77,6 @@ def _get_raw_key(self, key_id):
7877
key_bits = int(key_bits)
7978
key_type = _KEY_TYPES_MAP[algorithm]
8079
wrapping_algorithm = _WRAPPING_ALGORITHM_MAP[algorithm][key_bits][padding_algorithm][padding_hash]
81-
print('looking up {} {}'.format(algorithm, key_bits))
8280
static_key = _STATIC_KEYS[algorithm][key_bits]
8381
return WrappingKey(
8482
wrapping_algorithm=wrapping_algorithm,
@@ -113,7 +111,7 @@ class Scenario(object):
113111
key_ids = attr.ib(validator=attr.validators.instance_of(list))
114112

115113

116-
def _generate_test_cases():
114+
def _generate_test_cases(): # noqa=C901
117115
try:
118116
root_dir = os.path.abspath(file_root())
119117
except Exception: # pylint: disable=broad-except

test/integration/test_i_aws_encrytion_sdk_client.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import aws_encryption_sdk
2020
from aws_encryption_sdk.identifiers import Algorithm
21-
2221
from .integration_test_utils import setup_kms_master_key_provider, SKIP_MESSAGE, skip_tests
2322

2423

test/integration/test_i_xcompat_kms.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import pytest
1818

1919
import aws_encryption_sdk
20-
2120
from .integration_test_utils import setup_kms_master_key_provider, SKIP_MESSAGE, skip_tests
2221

2322

test/unit/test_crypto_authentication_signer.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import aws_encryption_sdk.internal.crypto.authentication
1919
from aws_encryption_sdk.internal.crypto.authentication import Signer
2020
from aws_encryption_sdk.internal.defaults import ALGORITHM
21-
2221
from .test_crypto import VALUES
2322

2423

test/unit/test_crypto_authentication_verifier.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import aws_encryption_sdk.internal.crypto.authentication
1919
from aws_encryption_sdk.internal.crypto.authentication import Verifier
2020
from aws_encryption_sdk.internal.defaults import ALGORITHM
21-
2221
from .test_crypto import VALUES
2322

2423

test/unit/test_crypto_elliptic_curve.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
_ecc_public_numbers_from_compressed_point, _ecc_static_length_signature,
2727
_ECCCurveParameters, generate_ecc_signing_key
2828
)
29-
3029
from .test_crypto import VALUES
3130

3231

test/unit/test_crypto_wrapping_keys.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import aws_encryption_sdk.internal.crypto.wrapping_keys
2121
from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey
2222
from aws_encryption_sdk.internal.structures import EncryptedData
23-
2423
from .test_crypto import VALUES
2524

2625

test/unit/test_providers_base_master_key_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Unit test suite to validate aws_encryption_sdk.key_providers.base.MasterKeyConfig"""
14-
from mock import sentinel
1514
import pytest
1615

1716
from aws_encryption_sdk.key_providers.base import MasterKeyConfig

test/unit/test_providers_base_master_key_provider.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
DecryptKeyError, IncorrectMasterKeyError, InvalidKeyIdError, MasterKeyProviderError
2222
)
2323
from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig
24-
2524
from .test_values import VALUES
2625

2726

test/unit/test_providers_raw_master_key_config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
"""Unit test suite to validate aws_encryption_sdk.key_providers.raw.RawMasterKeyConfig"""
1414
import pytest
15+
import six
1516

1617
from aws_encryption_sdk.identifiers import EncryptionKeyType, WrappingAlgorithm
1718
from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey
@@ -50,4 +51,4 @@ def test_parent():
5051
@pytest.mark.parametrize('cls, kwargs', all_valid_kwargs(VALID_KWARGS))
5152
def test_attributes_converts(cls, kwargs):
5253
test = cls(**kwargs)
53-
assert isinstance(test.provider_id, str)
54+
assert isinstance(test.provider_id, six.string_types)

test/unit/test_streaming_client_configs.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig
2121
from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager
2222
from aws_encryption_sdk.materials_managers.default import DefaultCryptoMaterialsManager
23-
from aws_encryption_sdk.streaming_client import _ClientConfig, EncryptorConfig, DecryptorConfig
23+
from aws_encryption_sdk.streaming_client import _ClientConfig, DecryptorConfig, EncryptorConfig
2424
from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs, build_valid_kwargs_list
2525

2626

@@ -64,8 +64,8 @@ def _new_master_key(self, key_id):
6464
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), key_provider=FakeMasterKeyProvider())
6565
],
6666
EncryptorConfig: [
67-
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), encryption_context=None),
68-
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), frame_length=None)
67+
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), encryption_context=None),
68+
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), frame_length=None)
6969
],
7070
DecryptorConfig: [
7171
dict(source=b'', materials_manager=FakeCryptoMaterialsManager(), max_body_length='not an int')

0 commit comments

Comments
 (0)