From 1a3af6351e4eb626902b44985cd22322a014f249 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 12:11:35 -0700 Subject: [PATCH 01/13] reorganize keyring tests to match #100 and keyring namespace to simplify names --- .../{keyring => keyrings}/__init__.py | 0 .../{keyring => keyrings}/base.py | 0 .../{keyring/multi_keyring.py => keyrings/multi.py} | 0 .../{keyring/raw_keyring.py => keyrings/raw.py} | 0 test/__init__.py | 0 test/functional/aws_encryption_sdk/__init__.py | 13 +++++++++++++ .../key_providers/__init__.py | 0 .../key_providers/test_base.py | 0 .../aws_encryption_sdk/keyrings/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/keyrings/raw/__init__.py | 13 +++++++++++++ .../keyrings/raw/test_raw_aes.py} | 2 +- .../keyrings/raw/test_raw_rsa.py} | 2 +- .../keyrings/test_multi.py} | 4 ++-- test/unit/aws_encryption_sdk/__init__.py | 13 +++++++++++++ test/unit/aws_encryption_sdk/keyrings/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/keyrings/raw/__init__.py | 13 +++++++++++++ .../keyrings/raw/test_raw_aes.py} | 10 +++++----- .../keyrings/raw/test_raw_rsa.py} | 12 ++++++------ .../keyrings/test_base.py} | 0 .../keyrings/test_multi.py} | 6 +++--- test/unit/unit_test_utils.py | 4 ++-- 21 files changed, 98 insertions(+), 20 deletions(-) rename src/aws_encryption_sdk/{keyring => keyrings}/__init__.py (100%) rename src/aws_encryption_sdk/{keyring => keyrings}/base.py (100%) rename src/aws_encryption_sdk/{keyring/multi_keyring.py => keyrings/multi.py} (100%) rename src/aws_encryption_sdk/{keyring/raw_keyring.py => keyrings/raw.py} (100%) create mode 100644 test/__init__.py create mode 100644 test/functional/aws_encryption_sdk/__init__.py rename test/functional/{ => aws_encryption_sdk}/key_providers/__init__.py (100%) rename test/functional/{ => aws_encryption_sdk}/key_providers/test_base.py (100%) create mode 100644 test/functional/aws_encryption_sdk/keyrings/__init__.py create mode 100644 test/functional/aws_encryption_sdk/keyrings/raw/__init__.py rename test/functional/{test_f_keyring_raw_aes.py => aws_encryption_sdk/keyrings/raw/test_raw_aes.py} (99%) rename test/functional/{test_f_keyring_raw_rsa.py => aws_encryption_sdk/keyrings/raw/test_raw_rsa.py} (99%) rename test/functional/{test_f_multi_keyring.py => aws_encryption_sdk/keyrings/test_multi.py} (97%) create mode 100644 test/unit/aws_encryption_sdk/__init__.py create mode 100644 test/unit/aws_encryption_sdk/keyrings/__init__.py create mode 100644 test/unit/aws_encryption_sdk/keyrings/raw/__init__.py rename test/unit/{test_keyring_raw_aes.py => aws_encryption_sdk/keyrings/raw/test_raw_aes.py} (96%) rename test/unit/{test_keyring_raw_rsa.py => aws_encryption_sdk/keyrings/raw/test_raw_rsa.py} (96%) rename test/unit/{test_keyring_base.py => aws_encryption_sdk/keyrings/test_base.py} (100%) rename test/unit/{test_keyring_multi.py => aws_encryption_sdk/keyrings/test_multi.py} (98%) diff --git a/src/aws_encryption_sdk/keyring/__init__.py b/src/aws_encryption_sdk/keyrings/__init__.py similarity index 100% rename from src/aws_encryption_sdk/keyring/__init__.py rename to src/aws_encryption_sdk/keyrings/__init__.py diff --git a/src/aws_encryption_sdk/keyring/base.py b/src/aws_encryption_sdk/keyrings/base.py similarity index 100% rename from src/aws_encryption_sdk/keyring/base.py rename to src/aws_encryption_sdk/keyrings/base.py diff --git a/src/aws_encryption_sdk/keyring/multi_keyring.py b/src/aws_encryption_sdk/keyrings/multi.py similarity index 100% rename from src/aws_encryption_sdk/keyring/multi_keyring.py rename to src/aws_encryption_sdk/keyrings/multi.py diff --git a/src/aws_encryption_sdk/keyring/raw_keyring.py b/src/aws_encryption_sdk/keyrings/raw.py similarity index 100% rename from src/aws_encryption_sdk/keyring/raw_keyring.py rename to src/aws_encryption_sdk/keyrings/raw.py diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/functional/aws_encryption_sdk/__init__.py b/test/functional/aws_encryption_sdk/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/functional/aws_encryption_sdk/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/key_providers/__init__.py b/test/functional/aws_encryption_sdk/key_providers/__init__.py similarity index 100% rename from test/functional/key_providers/__init__.py rename to test/functional/aws_encryption_sdk/key_providers/__init__.py diff --git a/test/functional/key_providers/test_base.py b/test/functional/aws_encryption_sdk/key_providers/test_base.py similarity index 100% rename from test/functional/key_providers/test_base.py rename to test/functional/aws_encryption_sdk/key_providers/test_base.py diff --git a/test/functional/aws_encryption_sdk/keyrings/__init__.py b/test/functional/aws_encryption_sdk/keyrings/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/functional/aws_encryption_sdk/keyrings/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py b/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/test_f_keyring_raw_aes.py b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py similarity index 99% rename from test/functional/test_f_keyring_raw_aes.py rename to test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py index aa08b07ff..b1039a268 100644 --- a/test/functional/test_f_keyring_raw_aes.py +++ b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py @@ -24,7 +24,7 @@ from aws_encryption_sdk.internal.crypto import WrappingKey from aws_encryption_sdk.internal.formatting.serialize import serialize_raw_master_key_prefix from aws_encryption_sdk.key_providers.raw import RawMasterKey -from aws_encryption_sdk.keyring.raw_keyring import RawAESKeyring +from aws_encryption_sdk.keyring.raw import RawAESKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/functional/test_f_keyring_raw_rsa.py b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py similarity index 99% rename from test/functional/test_f_keyring_raw_rsa.py rename to test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py index bdf5bf25c..b25907adf 100644 --- a/test/functional/test_f_keyring_raw_rsa.py +++ b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py @@ -26,7 +26,7 @@ ) from aws_encryption_sdk.internal.crypto import WrappingKey from aws_encryption_sdk.key_providers.raw import RawMasterKey -from aws_encryption_sdk.keyring.raw_keyring import RawRSAKeyring +from aws_encryption_sdk.keyring.raw import RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/functional/test_f_multi_keyring.py b/test/functional/aws_encryption_sdk/keyrings/test_multi.py similarity index 97% rename from test/functional/test_f_multi_keyring.py rename to test/functional/aws_encryption_sdk/keyrings/test_multi.py index 54d519f0b..05fd11bbf 100644 --- a/test/functional/test_f_multi_keyring.py +++ b/test/functional/aws_encryption_sdk/keyrings/test_multi.py @@ -18,8 +18,8 @@ from aws_encryption_sdk.identifiers import KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.defaults import ALGORITHM -from aws_encryption_sdk.keyring.multi_keyring import MultiKeyring -from aws_encryption_sdk.keyring.raw_keyring import RawAESKeyring, RawRSAKeyring +from aws_encryption_sdk.keyring.multi import MultiKeyring +from aws_encryption_sdk.keyring.raw import RawAESKeyring, RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/unit/aws_encryption_sdk/__init__.py b/test/unit/aws_encryption_sdk/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/keyrings/__init__.py b/test/unit/aws_encryption_sdk/keyrings/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/keyrings/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/__init__.py b/test/unit/aws_encryption_sdk/keyrings/raw/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/keyrings/raw/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_keyring_raw_aes.py b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py similarity index 96% rename from test/unit/test_keyring_raw_aes.py rename to test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py index b98279d04..bde97ea9a 100644 --- a/test/unit/test_keyring_raw_aes.py +++ b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py @@ -19,15 +19,15 @@ from pytest_mock import mocker # noqa pylint: disable=unused-import import aws_encryption_sdk.key_providers.raw -import aws_encryption_sdk.keyring.raw_keyring +import aws_encryption_sdk.keyring.raw from aws_encryption_sdk.identifiers import Algorithm, KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.raw_keyring import GenerateKeyError, RawAESKeyring, _generate_data_key +from aws_encryption_sdk.keyring.raw import GenerateKeyError, RawAESKeyring, _generate_data_key from aws_encryption_sdk.materials_managers import EncryptionMaterials from aws_encryption_sdk.structures import MasterKeyInfo -from .unit_test_utils import ( +from ....unit_test_utils import ( _DATA_KEY, _ENCRYPTED_DATA_KEY_AES, _ENCRYPTED_DATA_KEY_NOT_IN_KEYRING, @@ -57,8 +57,8 @@ def raw_aes_keyring(): @pytest.fixture def patch_generate_data_key(mocker): - mocker.patch.object(aws_encryption_sdk.keyring.raw_keyring, "_generate_data_key") - return aws_encryption_sdk.keyring.raw_keyring._generate_data_key + mocker.patch.object(aws_encryption_sdk.keyring.raw, "_generate_data_key") + return aws_encryption_sdk.keyring.raw._generate_data_key @pytest.fixture diff --git a/test/unit/test_keyring_raw_rsa.py b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py similarity index 96% rename from test/unit/test_keyring_raw_rsa.py rename to test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py index 1fcf23da5..8b8d44ea8 100644 --- a/test/unit/test_keyring_raw_rsa.py +++ b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py @@ -17,14 +17,14 @@ from pytest_mock import mocker # noqa pylint: disable=unused-import import aws_encryption_sdk.key_providers.raw -import aws_encryption_sdk.keyring.raw_keyring +import aws_encryption_sdk.keyring.raw from aws_encryption_sdk.identifiers import KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.raw_keyring import RawRSAKeyring +from aws_encryption_sdk.keyring.raw import RawRSAKeyring -from .test_values import VALUES -from .unit_test_utils import ( +from ....test_values import VALUES +from ....unit_test_utils import ( _BACKEND, _DATA_KEY, _ENCRYPTED_DATA_KEY_RSA, @@ -58,8 +58,8 @@ def raw_rsa_private_key(): @pytest.fixture def patch_generate_data_key(mocker): - mocker.patch.object(aws_encryption_sdk.keyring.raw_keyring, "_generate_data_key") - return aws_encryption_sdk.keyring.raw_keyring._generate_data_key + mocker.patch.object(aws_encryption_sdk.keyring.raw, "_generate_data_key") + return aws_encryption_sdk.keyring.raw._generate_data_key @pytest.fixture diff --git a/test/unit/test_keyring_base.py b/test/unit/aws_encryption_sdk/keyrings/test_base.py similarity index 100% rename from test/unit/test_keyring_base.py rename to test/unit/aws_encryption_sdk/keyrings/test_base.py diff --git a/test/unit/test_keyring_multi.py b/test/unit/aws_encryption_sdk/keyrings/test_multi.py similarity index 98% rename from test/unit/test_keyring_multi.py rename to test/unit/aws_encryption_sdk/keyrings/test_multi.py index 6b66a490f..2a821b41e 100644 --- a/test/unit/test_keyring_multi.py +++ b/test/unit/aws_encryption_sdk/keyrings/test_multi.py @@ -20,10 +20,10 @@ from aws_encryption_sdk.identifiers import WrappingAlgorithm from aws_encryption_sdk.internal.formatting import serialize from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.multi_keyring import MultiKeyring -from aws_encryption_sdk.keyring.raw_keyring import RawAESKeyring +from aws_encryption_sdk.keyring.multi import MultiKeyring +from aws_encryption_sdk.keyring.raw import RawAESKeyring -from .unit_test_utils import ( +from ...unit_test_utils import ( IdentityKeyring, OnlyGenerateKeyring, get_decryption_materials_with_data_key, diff --git a/test/unit/unit_test_utils.py b/test/unit/unit_test_utils.py index 1e5d073e8..114faac13 100644 --- a/test/unit/unit_test_utils.py +++ b/test/unit/unit_test_utils.py @@ -22,8 +22,8 @@ from aws_encryption_sdk.identifiers import Algorithm, KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.utils.streams import InsistentReaderBytesIO from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.multi_keyring import MultiKeyring -from aws_encryption_sdk.keyring.raw_keyring import RawAESKeyring, RawRSAKeyring +from aws_encryption_sdk.keyring.multi import MultiKeyring +from aws_encryption_sdk.keyring.raw import RawAESKeyring, RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import EncryptedDataKey, KeyringTrace, MasterKeyInfo, RawDataKey From 9ffbaadf5c2b65f373c65878d47d341aa0a431df Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 13:19:59 -0700 Subject: [PATCH 02/13] change aws_encryption_sdk.keyring to aws_encryption_sdk.keyrings for consistency in namespace names --- src/aws_encryption_sdk/keyrings/base.py | 4 ++-- src/aws_encryption_sdk/keyrings/multi.py | 12 ++++++++---- src/aws_encryption_sdk/keyrings/raw.py | 13 ++++++++----- .../aws_encryption_sdk/keyrings/raw/test_raw_aes.py | 2 +- .../aws_encryption_sdk/keyrings/raw/test_raw_rsa.py | 2 +- .../aws_encryption_sdk/keyrings/test_multi.py | 4 ++-- .../aws_encryption_sdk/keyrings/raw/test_raw_aes.py | 10 +++++----- .../aws_encryption_sdk/keyrings/raw/test_raw_rsa.py | 10 +++++----- test/unit/aws_encryption_sdk/keyrings/test_base.py | 2 +- test/unit/aws_encryption_sdk/keyrings/test_multi.py | 10 +++++----- test/unit/test_utils.py | 2 +- test/unit/unit_test_utils.py | 6 +++--- 12 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/aws_encryption_sdk/keyrings/base.py b/src/aws_encryption_sdk/keyrings/base.py index 236037b4e..4317bee50 100644 --- a/src/aws_encryption_sdk/keyrings/base.py +++ b/src/aws_encryption_sdk/keyrings/base.py @@ -11,11 +11,11 @@ # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. """Base class interface for Keyrings.""" -from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import,duplicate-code +from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import DecryptionMaterials, EncryptionMaterials, ) -from aws_encryption_sdk.structures import ( # only used for mypy; pylint: disable=unused-import,duplicate-code +from aws_encryption_sdk.structures import ( # only used for mypy; pylint: disable=unused-import EncryptedDataKey, ) diff --git a/src/aws_encryption_sdk/keyrings/multi.py b/src/aws_encryption_sdk/keyrings/multi.py index cb2b5cc79..34b2458a2 100644 --- a/src/aws_encryption_sdk/keyrings/multi.py +++ b/src/aws_encryption_sdk/keyrings/multi.py @@ -17,10 +17,14 @@ from attr.validators import deep_iterable, instance_of, optional from aws_encryption_sdk.exceptions import EncryptKeyError, GenerateKeyError -from aws_encryption_sdk.keyring.base import DecryptionMaterials # only used for mypy so pylint: disable=unused-import -from aws_encryption_sdk.keyring.base import EncryptionMaterials # only used for mypy so pylint: disable=unused-import -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.structures import EncryptedDataKey # only used for mypy so pylint: disable=unused-import +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import + DecryptionMaterials, + EncryptionMaterials, +) +from aws_encryption_sdk.structures import ( # only used for mypy; pylint: disable=unused-import + EncryptedDataKey, +) try: # Python 3.5.0 and 3.5.1 have incompatible typing modules from typing import Iterable # noqa pylint: disable=unused-import diff --git a/src/aws_encryption_sdk/keyrings/raw.py b/src/aws_encryption_sdk/keyrings/raw.py index 922f6ae0c..9e2f3e58e 100644 --- a/src/aws_encryption_sdk/keyrings/raw.py +++ b/src/aws_encryption_sdk/keyrings/raw.py @@ -11,7 +11,6 @@ # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. """Resources required for Raw Keyrings.""" - import logging import os @@ -28,13 +27,17 @@ from aws_encryption_sdk.internal.formatting.deserialize import deserialize_wrapped_key from aws_encryption_sdk.internal.formatting.serialize import serialize_raw_master_key_prefix, serialize_wrapped_key from aws_encryption_sdk.key_providers.raw import RawMasterKey -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.materials_managers import ( # only used for mypy so pylint: disable=unused-import +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import DecryptionMaterials, EncryptionMaterials, ) -from aws_encryption_sdk.structures import EncryptedDataKey # only used for mypy so pylint: disable=unused-import -from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey +from aws_encryption_sdk.structures import ( # pylint: disable=unused-import + EncryptedDataKey, + KeyringTrace, + MasterKeyInfo, + RawDataKey, +) try: # Python 3.5.0 and 3.5.1 have incompatible typing modules from typing import Iterable # noqa pylint: disable=unused-import diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py index b1039a268..0cfad9d2c 100644 --- a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py +++ b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py @@ -24,7 +24,7 @@ from aws_encryption_sdk.internal.crypto import WrappingKey from aws_encryption_sdk.internal.formatting.serialize import serialize_raw_master_key_prefix from aws_encryption_sdk.key_providers.raw import RawMasterKey -from aws_encryption_sdk.keyring.raw import RawAESKeyring +from aws_encryption_sdk.keyrings.raw import RawAESKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py index b25907adf..d900c5cdf 100644 --- a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py +++ b/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py @@ -26,7 +26,7 @@ ) from aws_encryption_sdk.internal.crypto import WrappingKey from aws_encryption_sdk.key_providers.raw import RawMasterKey -from aws_encryption_sdk.keyring.raw import RawRSAKeyring +from aws_encryption_sdk.keyrings.raw import RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/functional/aws_encryption_sdk/keyrings/test_multi.py b/test/functional/aws_encryption_sdk/keyrings/test_multi.py index 05fd11bbf..c6de06f0e 100644 --- a/test/functional/aws_encryption_sdk/keyrings/test_multi.py +++ b/test/functional/aws_encryption_sdk/keyrings/test_multi.py @@ -18,8 +18,8 @@ from aws_encryption_sdk.identifiers import KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.defaults import ALGORITHM -from aws_encryption_sdk.keyring.multi import MultiKeyring -from aws_encryption_sdk.keyring.raw import RawAESKeyring, RawRSAKeyring +from aws_encryption_sdk.keyrings.multi import MultiKeyring +from aws_encryption_sdk.keyrings.raw import RawAESKeyring, RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import KeyringTrace, MasterKeyInfo, RawDataKey diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py index bde97ea9a..c12a4e565 100644 --- a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py +++ b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py @@ -19,11 +19,11 @@ from pytest_mock import mocker # noqa pylint: disable=unused-import import aws_encryption_sdk.key_providers.raw -import aws_encryption_sdk.keyring.raw +import aws_encryption_sdk.keyrings.raw from aws_encryption_sdk.identifiers import Algorithm, KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.raw import GenerateKeyError, RawAESKeyring, _generate_data_key +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.keyrings.raw import GenerateKeyError, RawAESKeyring, _generate_data_key from aws_encryption_sdk.materials_managers import EncryptionMaterials from aws_encryption_sdk.structures import MasterKeyInfo @@ -57,8 +57,8 @@ def raw_aes_keyring(): @pytest.fixture def patch_generate_data_key(mocker): - mocker.patch.object(aws_encryption_sdk.keyring.raw, "_generate_data_key") - return aws_encryption_sdk.keyring.raw._generate_data_key + mocker.patch.object(aws_encryption_sdk.keyrings.raw, "_generate_data_key") + return aws_encryption_sdk.keyrings.raw._generate_data_key @pytest.fixture diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py index 8b8d44ea8..b2972cbdc 100644 --- a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py +++ b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py @@ -17,11 +17,11 @@ from pytest_mock import mocker # noqa pylint: disable=unused-import import aws_encryption_sdk.key_providers.raw -import aws_encryption_sdk.keyring.raw +import aws_encryption_sdk.keyrings.raw from aws_encryption_sdk.identifiers import KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.raw import RawRSAKeyring +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.keyrings.raw import RawRSAKeyring from ....test_values import VALUES from ....unit_test_utils import ( @@ -58,8 +58,8 @@ def raw_rsa_private_key(): @pytest.fixture def patch_generate_data_key(mocker): - mocker.patch.object(aws_encryption_sdk.keyring.raw, "_generate_data_key") - return aws_encryption_sdk.keyring.raw._generate_data_key + mocker.patch.object(aws_encryption_sdk.keyrings.raw, "_generate_data_key") + return aws_encryption_sdk.keyrings.raw._generate_data_key @pytest.fixture diff --git a/test/unit/aws_encryption_sdk/keyrings/test_base.py b/test/unit/aws_encryption_sdk/keyrings/test_base.py index 70863de53..08522de0a 100644 --- a/test/unit/aws_encryption_sdk/keyrings/test_base.py +++ b/test/unit/aws_encryption_sdk/keyrings/test_base.py @@ -15,7 +15,7 @@ import pytest from aws_encryption_sdk.identifiers import Algorithm -from aws_encryption_sdk.keyring.base import Keyring +from aws_encryption_sdk.keyrings.base import Keyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/keyrings/test_multi.py b/test/unit/aws_encryption_sdk/keyrings/test_multi.py index 2a821b41e..59a87adf3 100644 --- a/test/unit/aws_encryption_sdk/keyrings/test_multi.py +++ b/test/unit/aws_encryption_sdk/keyrings/test_multi.py @@ -19,9 +19,9 @@ from aws_encryption_sdk.exceptions import EncryptKeyError, GenerateKeyError from aws_encryption_sdk.identifiers import WrappingAlgorithm from aws_encryption_sdk.internal.formatting import serialize -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.multi import MultiKeyring -from aws_encryption_sdk.keyring.raw import RawAESKeyring +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.keyrings.multi import MultiKeyring +from aws_encryption_sdk.keyrings.raw import RawAESKeyring from ...unit_test_utils import ( IdentityKeyring, @@ -139,10 +139,10 @@ def test_keyring_with_no_generator_no_children(): def test_keyring_with_invalid_parameters(generator, children): with pytest.raises(TypeError) as exc_info: MultiKeyring(generator=generator, children=children) - assert exc_info.match("('children'|'generator') must be .*") + assert exc_info.match("('children'|'generator') must be .*") -def test_decryption_keyrings(): +def test_decryption_keyring(): test_multi_keyring = get_multi_keyring_with_generator_and_children() assert test_multi_keyring.generator in test_multi_keyring._decryption_keyrings for child_keyring in test_multi_keyring.children: diff --git a/test/unit/test_utils.py b/test/unit/test_utils.py index 0dee36b41..b83e5de1d 100644 --- a/test/unit/test_utils.py +++ b/test/unit/test_utils.py @@ -21,7 +21,7 @@ import aws_encryption_sdk.internal.utils from aws_encryption_sdk.exceptions import InvalidDataKeyError, SerializationError, UnknownIdentityError from aws_encryption_sdk.internal.defaults import MAX_FRAME_SIZE, MESSAGE_ID_LENGTH -from aws_encryption_sdk.keyring.base import EncryptedDataKey +from aws_encryption_sdk.keyrings.base import EncryptedDataKey from aws_encryption_sdk.structures import DataKey, MasterKeyInfo, RawDataKey from .test_values import VALUES diff --git a/test/unit/unit_test_utils.py b/test/unit/unit_test_utils.py index 114faac13..2bf1bc838 100644 --- a/test/unit/unit_test_utils.py +++ b/test/unit/unit_test_utils.py @@ -21,9 +21,9 @@ from aws_encryption_sdk.identifiers import Algorithm, KeyringTraceFlag, WrappingAlgorithm from aws_encryption_sdk.internal.utils.streams import InsistentReaderBytesIO -from aws_encryption_sdk.keyring.base import Keyring -from aws_encryption_sdk.keyring.multi import MultiKeyring -from aws_encryption_sdk.keyring.raw import RawAESKeyring, RawRSAKeyring +from aws_encryption_sdk.keyrings.base import Keyring +from aws_encryption_sdk.keyrings.multi import MultiKeyring +from aws_encryption_sdk.keyrings.raw import RawAESKeyring, RawRSAKeyring from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials from aws_encryption_sdk.structures import EncryptedDataKey, KeyringTrace, MasterKeyInfo, RawDataKey From 66081067c95250fc1d0a56a103b744bb7fee8c10 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 19:34:07 -0700 Subject: [PATCH 03/13] autoformat --- src/aws_encryption_sdk/keyrings/base.py | 4 +--- src/aws_encryption_sdk/keyrings/multi.py | 5 ++--- src/aws_encryption_sdk/keyrings/raw.py | 9 +++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/aws_encryption_sdk/keyrings/base.py b/src/aws_encryption_sdk/keyrings/base.py index 4317bee50..32f810e47 100644 --- a/src/aws_encryption_sdk/keyrings/base.py +++ b/src/aws_encryption_sdk/keyrings/base.py @@ -15,9 +15,7 @@ DecryptionMaterials, EncryptionMaterials, ) -from aws_encryption_sdk.structures import ( # only used for mypy; pylint: disable=unused-import - EncryptedDataKey, -) +from aws_encryption_sdk.structures import EncryptedDataKey # only used for mypy; pylint: disable=unused-import try: # Python 3.5.0 and 3.5.1 have incompatible typing modules from typing import Iterable # noqa pylint: disable=unused-import diff --git a/src/aws_encryption_sdk/keyrings/multi.py b/src/aws_encryption_sdk/keyrings/multi.py index 34b2458a2..4274c1c4d 100644 --- a/src/aws_encryption_sdk/keyrings/multi.py +++ b/src/aws_encryption_sdk/keyrings/multi.py @@ -18,13 +18,12 @@ from aws_encryption_sdk.exceptions import EncryptKeyError, GenerateKeyError from aws_encryption_sdk.keyrings.base import Keyring + from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import DecryptionMaterials, EncryptionMaterials, ) -from aws_encryption_sdk.structures import ( # only used for mypy; pylint: disable=unused-import - EncryptedDataKey, -) +from aws_encryption_sdk.structures import EncryptedDataKey # only used for mypy; pylint: disable=unused-import try: # Python 3.5.0 and 3.5.1 have incompatible typing modules from typing import Iterable # noqa pylint: disable=unused-import diff --git a/src/aws_encryption_sdk/keyrings/raw.py b/src/aws_encryption_sdk/keyrings/raw.py index 9e2f3e58e..dea924eae 100644 --- a/src/aws_encryption_sdk/keyrings/raw.py +++ b/src/aws_encryption_sdk/keyrings/raw.py @@ -28,10 +28,6 @@ from aws_encryption_sdk.internal.formatting.serialize import serialize_raw_master_key_prefix, serialize_wrapped_key from aws_encryption_sdk.key_providers.raw import RawMasterKey from aws_encryption_sdk.keyrings.base import Keyring -from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import - DecryptionMaterials, - EncryptionMaterials, -) from aws_encryption_sdk.structures import ( # pylint: disable=unused-import EncryptedDataKey, KeyringTrace, @@ -39,6 +35,11 @@ RawDataKey, ) +from aws_encryption_sdk.materials_managers import ( # only used for mypy; pylint: disable=unused-import + DecryptionMaterials, + EncryptionMaterials, +) + try: # Python 3.5.0 and 3.5.1 have incompatible typing modules from typing import Iterable # noqa pylint: disable=unused-import except ImportError: # pragma: no cover From 282bc5f5cd12480afa9bff3cdac3219bcb8fcfba Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 19:35:07 -0700 Subject: [PATCH 04/13] disable pylint similarity checks on imports Because we provide multiple implementations of certain types of things (keyrings, etc), this was triggering pylint due to them all needing to import the same types in order to function. --- src/pylintrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylintrc b/src/pylintrc index af00ced56..1722f208c 100644 --- a/src/pylintrc +++ b/src/pylintrc @@ -33,6 +33,9 @@ additional-builtins = raw_input [DESIGN] max-args = 10 +[SIMILARITIES] +ignore-imports = yes + [FORMAT] max-line-length = 120 From 8c33bd30024c2648bc39ee725a665d56422c1620 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 14:08:39 -0700 Subject: [PATCH 05/13] reorganize functional and integration tests --- .../aws_encryption_sdk/internal/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/internal/crypto/__init__.py | 13 +++++++++++++ .../internal/crypto/test_crypto.py} | 0 .../internal/crypto/test_iv.py} | 0 .../test_client.py} | 0 test/integration/aws_encryption_sdk/__init__.py | 13 +++++++++++++ .../test_client.py} | 2 +- .../test_thread_safety.py} | 2 +- 8 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 test/functional/aws_encryption_sdk/internal/__init__.py create mode 100644 test/functional/aws_encryption_sdk/internal/crypto/__init__.py rename test/functional/{test_f_crypto.py => aws_encryption_sdk/internal/crypto/test_crypto.py} (100%) rename test/functional/{test_f_crypto_iv.py => aws_encryption_sdk/internal/crypto/test_iv.py} (100%) rename test/functional/{test_f_aws_encryption_sdk_client.py => aws_encryption_sdk/test_client.py} (100%) create mode 100644 test/integration/aws_encryption_sdk/__init__.py rename test/integration/{test_i_aws_encrytion_sdk_client.py => aws_encryption_sdk/test_client.py} (99%) rename test/integration/{test_i_thread_safety.py => aws_encryption_sdk/test_thread_safety.py} (98%) diff --git a/test/functional/aws_encryption_sdk/internal/__init__.py b/test/functional/aws_encryption_sdk/internal/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/functional/aws_encryption_sdk/internal/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/aws_encryption_sdk/internal/crypto/__init__.py b/test/functional/aws_encryption_sdk/internal/crypto/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/functional/aws_encryption_sdk/internal/crypto/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/test_f_crypto.py b/test/functional/aws_encryption_sdk/internal/crypto/test_crypto.py similarity index 100% rename from test/functional/test_f_crypto.py rename to test/functional/aws_encryption_sdk/internal/crypto/test_crypto.py diff --git a/test/functional/test_f_crypto_iv.py b/test/functional/aws_encryption_sdk/internal/crypto/test_iv.py similarity index 100% rename from test/functional/test_f_crypto_iv.py rename to test/functional/aws_encryption_sdk/internal/crypto/test_iv.py diff --git a/test/functional/test_f_aws_encryption_sdk_client.py b/test/functional/aws_encryption_sdk/test_client.py similarity index 100% rename from test/functional/test_f_aws_encryption_sdk_client.py rename to test/functional/aws_encryption_sdk/test_client.py diff --git a/test/integration/aws_encryption_sdk/__init__.py b/test/integration/aws_encryption_sdk/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/integration/aws_encryption_sdk/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/integration/test_i_aws_encrytion_sdk_client.py b/test/integration/aws_encryption_sdk/test_client.py similarity index 99% rename from test/integration/test_i_aws_encrytion_sdk_client.py rename to test/integration/aws_encryption_sdk/test_client.py index 26df431dc..c536f46c4 100644 --- a/test/integration/test_i_aws_encrytion_sdk_client.py +++ b/test/integration/aws_encryption_sdk/test_client.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.identifiers import USER_AGENT_SUFFIX, Algorithm from aws_encryption_sdk.key_providers.kms import KMSMasterKey, KMSMasterKeyProvider -from .integration_test_utils import ( +from ..integration_test_utils import ( get_cmk_arn, setup_kms_master_key_provider, setup_kms_master_key_provider_with_botocore_session, diff --git a/test/integration/test_i_thread_safety.py b/test/integration/aws_encryption_sdk/test_thread_safety.py similarity index 98% rename from test/integration/test_i_thread_safety.py rename to test/integration/aws_encryption_sdk/test_thread_safety.py index 006856801..6d4fb796a 100644 --- a/test/integration/test_i_thread_safety.py +++ b/test/integration/aws_encryption_sdk/test_thread_safety.py @@ -23,7 +23,7 @@ import aws_encryption_sdk -from .integration_test_utils import get_cmk_arn, setup_kms_master_key_provider +from ..integration_test_utils import get_cmk_arn, setup_kms_master_key_provider pytestmark = [pytest.mark.integ] From f0662b6f38444d28c7e891223d9d0dfe499f5b7d Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 14:09:45 -0700 Subject: [PATCH 06/13] define structure for unit tests reorg --- test/unit/aws_encryption_sdk/caches/__init__.py | 13 +++++++++++++ test/unit/aws_encryption_sdk/internal/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/internal/crypto/__init__.py | 13 +++++++++++++ .../internal/formatting/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/internal/utils/__init__.py | 13 +++++++++++++ .../aws_encryption_sdk/key_providers/__init__.py | 13 +++++++++++++ .../materials_managers/__init__.py | 13 +++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 test/unit/aws_encryption_sdk/caches/__init__.py create mode 100644 test/unit/aws_encryption_sdk/internal/__init__.py create mode 100644 test/unit/aws_encryption_sdk/internal/crypto/__init__.py create mode 100644 test/unit/aws_encryption_sdk/internal/formatting/__init__.py create mode 100644 test/unit/aws_encryption_sdk/internal/utils/__init__.py create mode 100644 test/unit/aws_encryption_sdk/key_providers/__init__.py create mode 100644 test/unit/aws_encryption_sdk/materials_managers/__init__.py diff --git a/test/unit/aws_encryption_sdk/caches/__init__.py b/test/unit/aws_encryption_sdk/caches/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/caches/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/internal/__init__.py b/test/unit/aws_encryption_sdk/internal/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/internal/crypto/__init__.py b/test/unit/aws_encryption_sdk/internal/crypto/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/crypto/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/internal/formatting/__init__.py b/test/unit/aws_encryption_sdk/internal/formatting/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/formatting/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/internal/utils/__init__.py b/test/unit/aws_encryption_sdk/internal/utils/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/utils/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/key_providers/__init__.py b/test/unit/aws_encryption_sdk/key_providers/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/key_providers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/materials_managers/__init__.py b/test/unit/aws_encryption_sdk/materials_managers/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/materials_managers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" From b6e7f3529a54758bd0eb320c1b5f22ec4beec404 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 14:30:42 -0700 Subject: [PATCH 07/13] reorganize unit tests --- .../caches/test_base.py} | 0 .../{ => aws_encryption_sdk/caches}/test_caches.py | 0 .../caches/test_crypto_cache_entry.py} | 0 .../caches/test_local.py} | 0 .../caches/test_null.py} | 0 .../internal/crypto/authentication/__init__.py | 13 +++++++++++++ .../test_prehashing_authenticator.py} | 0 .../internal/crypto/authentication/test_signer.py} | 2 +- .../crypto/authentication/test_verifier.py} | 2 +- .../internal/crypto/encryption/__init__.py | 13 +++++++++++++ .../internal/crypto/encryption/test_decryptor.py} | 0 .../internal/crypto/encryption/test_encryptor.py} | 0 .../internal/crypto}/test_crypto.py | 0 .../internal/crypto/test_data_keys.py} | 0 .../internal/crypto/test_elliptic_curve.py} | 2 -- .../internal/crypto/test_wrapping_keys.py} | 0 .../internal/formatting}/test_deserialize.py | 2 +- .../internal/formatting}/test_encryption_context.py | 2 +- .../internal/formatting}/test_serialize.py | 2 +- .../internal}/test_defaults.py | 0 .../internal/test_structures.py} | 2 +- .../internal/utils/test_str_ops.py} | 0 .../internal/utils/test_streams.py} | 2 +- .../internal/utils}/test_utils.py | 4 ++-- .../key_providers/base/__init__.py | 13 +++++++++++++ .../key_providers/base/test_base_master_key.py} | 2 +- .../base/test_base_master_key_config.py} | 2 +- .../base/test_base_master_key_provider.py} | 2 +- .../base/test_base_master_key_provider_config.py} | 0 .../key_providers/kms/__init__.py | 13 +++++++++++++ .../key_providers/kms/test_kms_master_key.py} | 2 +- .../kms/test_kms_master_key_config.py} | 2 +- .../kms/test_kms_master_key_provider.py} | 0 .../kms/test_kms_master_key_provider_config.py} | 2 +- .../key_providers/raw/__init__.py | 13 +++++++++++++ .../key_providers/raw/test_raw_master_key.py} | 2 +- .../raw/test_raw_master_key_config.py} | 2 +- .../raw/test_raw_master_key_provider.py} | 2 +- .../materials_managers/test_base.py} | 0 .../materials_managers/test_caching.py} | 0 .../materials_managers/test_default.py} | 0 .../materials_managers}/test_material_managers.py | 0 .../aws_encryption_sdk/streaming_client/__init__.py | 13 +++++++++++++ .../streaming_client/test_configs.py} | 2 +- .../streaming_client/test_encryption_stream.py} | 4 ++-- .../streaming_client/test_stream_decryptor.py} | 2 +- .../streaming_client/test_stream_encryptor.py} | 2 +- .../test_client.py} | 0 .../{ => aws_encryption_sdk}/test_identifiers.py | 0 .../{ => aws_encryption_sdk}/test_structures.py | 2 +- 50 files changed, 102 insertions(+), 26 deletions(-) rename test/unit/{test_caches_base.py => aws_encryption_sdk/caches/test_base.py} (100%) rename test/unit/{ => aws_encryption_sdk/caches}/test_caches.py (100%) rename test/unit/{test_caches_crypto_cache_entry.py => aws_encryption_sdk/caches/test_crypto_cache_entry.py} (100%) rename test/unit/{test_caches_local.py => aws_encryption_sdk/caches/test_local.py} (100%) rename test/unit/{test_caches_null.py => aws_encryption_sdk/caches/test_null.py} (100%) create mode 100644 test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py rename test/unit/{test_crypto_prehashing_authenticator.py => aws_encryption_sdk/internal/crypto/authentication/test_prehashing_authenticator.py} (100%) rename test/unit/{test_crypto_authentication_signer.py => aws_encryption_sdk/internal/crypto/authentication/test_signer.py} (99%) rename test/unit/{test_crypto_authentication_verifier.py => aws_encryption_sdk/internal/crypto/authentication/test_verifier.py} (99%) create mode 100644 test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py rename test/unit/{test_crypto_encryption_decryptor.py => aws_encryption_sdk/internal/crypto/encryption/test_decryptor.py} (100%) rename test/unit/{test_crypto_encryption_encryptor.py => aws_encryption_sdk/internal/crypto/encryption/test_encryptor.py} (100%) rename test/unit/{ => aws_encryption_sdk/internal/crypto}/test_crypto.py (100%) rename test/unit/{test_crypto_data_keys.py => aws_encryption_sdk/internal/crypto/test_data_keys.py} (100%) rename test/unit/{test_crypto_elliptic_curve.py => aws_encryption_sdk/internal/crypto/test_elliptic_curve.py} (99%) rename test/unit/{test_crypto_wrapping_keys.py => aws_encryption_sdk/internal/crypto/test_wrapping_keys.py} (100%) rename test/unit/{ => aws_encryption_sdk/internal/formatting}/test_deserialize.py (99%) rename test/unit/{ => aws_encryption_sdk/internal/formatting}/test_encryption_context.py (99%) rename test/unit/{ => aws_encryption_sdk/internal/formatting}/test_serialize.py (99%) rename test/unit/{ => aws_encryption_sdk/internal}/test_defaults.py (100%) rename test/unit/{test_internal_structures.py => aws_encryption_sdk/internal/test_structures.py} (97%) rename test/unit/{test_util_str_ops.py => aws_encryption_sdk/internal/utils/test_str_ops.py} (100%) rename test/unit/{test_util_streams.py => aws_encryption_sdk/internal/utils/test_streams.py} (96%) rename test/unit/{ => aws_encryption_sdk/internal/utils}/test_utils.py (99%) create mode 100644 test/unit/aws_encryption_sdk/key_providers/base/__init__.py rename test/unit/{test_providers_base_master_key.py => aws_encryption_sdk/key_providers/base/test_base_master_key.py} (99%) rename test/unit/{test_providers_base_master_key_config.py => aws_encryption_sdk/key_providers/base/test_base_master_key_config.py} (96%) rename test/unit/{test_providers_base_master_key_provider.py => aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py} (99%) rename test/unit/{test_providers_base_master_key_provider_config.py => aws_encryption_sdk/key_providers/base/test_base_master_key_provider_config.py} (100%) create mode 100644 test/unit/aws_encryption_sdk/key_providers/kms/__init__.py rename test/unit/{test_providers_kms_master_key.py => aws_encryption_sdk/key_providers/kms/test_kms_master_key.py} (99%) rename test/unit/{test_providers_kms_master_key_config.py => aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py} (96%) rename test/unit/{test_providers_kms_master_key_provider.py => aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider.py} (100%) rename test/unit/{test_providers_kms_master_key_provider_config.py => aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py} (97%) create mode 100644 test/unit/aws_encryption_sdk/key_providers/raw/__init__.py rename test/unit/{test_providers_raw_master_key.py => aws_encryption_sdk/key_providers/raw/test_raw_master_key.py} (99%) rename test/unit/{test_providers_raw_master_key_config.py => aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py} (96%) rename test/unit/{test_providers_raw_master_key_provider.py => aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py} (98%) rename test/unit/{test_material_managers_base.py => aws_encryption_sdk/materials_managers/test_base.py} (100%) rename test/unit/{test_material_managers_caching.py => aws_encryption_sdk/materials_managers/test_caching.py} (100%) rename test/unit/{test_material_managers_default.py => aws_encryption_sdk/materials_managers/test_default.py} (100%) rename test/unit/{ => aws_encryption_sdk/materials_managers}/test_material_managers.py (100%) create mode 100644 test/unit/aws_encryption_sdk/streaming_client/__init__.py rename test/unit/{test_streaming_client_configs.py => aws_encryption_sdk/streaming_client/test_configs.py} (98%) rename test/unit/{test_streaming_client_encryption_stream.py => aws_encryption_sdk/streaming_client/test_encryption_stream.py} (99%) rename test/unit/{test_streaming_client_stream_decryptor.py => aws_encryption_sdk/streaming_client/test_stream_decryptor.py} (99%) rename test/unit/{test_streaming_client_stream_encryptor.py => aws_encryption_sdk/streaming_client/test_stream_encryptor.py} (99%) rename test/unit/{test_aws_encryption_sdk.py => aws_encryption_sdk/test_client.py} (100%) rename test/unit/{ => aws_encryption_sdk}/test_identifiers.py (100%) rename test/unit/{ => aws_encryption_sdk}/test_structures.py (98%) diff --git a/test/unit/test_caches_base.py b/test/unit/aws_encryption_sdk/caches/test_base.py similarity index 100% rename from test/unit/test_caches_base.py rename to test/unit/aws_encryption_sdk/caches/test_base.py diff --git a/test/unit/test_caches.py b/test/unit/aws_encryption_sdk/caches/test_caches.py similarity index 100% rename from test/unit/test_caches.py rename to test/unit/aws_encryption_sdk/caches/test_caches.py diff --git a/test/unit/test_caches_crypto_cache_entry.py b/test/unit/aws_encryption_sdk/caches/test_crypto_cache_entry.py similarity index 100% rename from test/unit/test_caches_crypto_cache_entry.py rename to test/unit/aws_encryption_sdk/caches/test_crypto_cache_entry.py diff --git a/test/unit/test_caches_local.py b/test/unit/aws_encryption_sdk/caches/test_local.py similarity index 100% rename from test/unit/test_caches_local.py rename to test/unit/aws_encryption_sdk/caches/test_local.py diff --git a/test/unit/test_caches_null.py b/test/unit/aws_encryption_sdk/caches/test_null.py similarity index 100% rename from test/unit/test_caches_null.py rename to test/unit/aws_encryption_sdk/caches/test_null.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py b/test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_crypto_prehashing_authenticator.py b/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_prehashing_authenticator.py similarity index 100% rename from test/unit/test_crypto_prehashing_authenticator.py rename to test/unit/aws_encryption_sdk/internal/crypto/authentication/test_prehashing_authenticator.py diff --git a/test/unit/test_crypto_authentication_signer.py b/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_signer.py similarity index 99% rename from test/unit/test_crypto_authentication_signer.py rename to test/unit/aws_encryption_sdk/internal/crypto/authentication/test_signer.py index eae064130..f66e8303b 100644 --- a/test/unit/test_crypto_authentication_signer.py +++ b/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_signer.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.crypto.authentication import Signer from aws_encryption_sdk.internal.defaults import ALGORITHM -from .test_crypto import VALUES +from ..test_crypto import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_crypto_authentication_verifier.py b/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_verifier.py similarity index 99% rename from test/unit/test_crypto_authentication_verifier.py rename to test/unit/aws_encryption_sdk/internal/crypto/authentication/test_verifier.py index a55e8f517..fae840567 100644 --- a/test/unit/test_crypto_authentication_verifier.py +++ b/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_verifier.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.crypto.authentication import Verifier from aws_encryption_sdk.internal.defaults import ALGORITHM -from .test_crypto import VALUES +from ..test_crypto import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py b/test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_crypto_encryption_decryptor.py b/test/unit/aws_encryption_sdk/internal/crypto/encryption/test_decryptor.py similarity index 100% rename from test/unit/test_crypto_encryption_decryptor.py rename to test/unit/aws_encryption_sdk/internal/crypto/encryption/test_decryptor.py diff --git a/test/unit/test_crypto_encryption_encryptor.py b/test/unit/aws_encryption_sdk/internal/crypto/encryption/test_encryptor.py similarity index 100% rename from test/unit/test_crypto_encryption_encryptor.py rename to test/unit/aws_encryption_sdk/internal/crypto/encryption/test_encryptor.py diff --git a/test/unit/test_crypto.py b/test/unit/aws_encryption_sdk/internal/crypto/test_crypto.py similarity index 100% rename from test/unit/test_crypto.py rename to test/unit/aws_encryption_sdk/internal/crypto/test_crypto.py diff --git a/test/unit/test_crypto_data_keys.py b/test/unit/aws_encryption_sdk/internal/crypto/test_data_keys.py similarity index 100% rename from test/unit/test_crypto_data_keys.py rename to test/unit/aws_encryption_sdk/internal/crypto/test_data_keys.py diff --git a/test/unit/test_crypto_elliptic_curve.py b/test/unit/aws_encryption_sdk/internal/crypto/test_elliptic_curve.py similarity index 99% rename from test/unit/test_crypto_elliptic_curve.py rename to test/unit/aws_encryption_sdk/internal/crypto/test_elliptic_curve.py index b030db5c2..ff5437b98 100644 --- a/test/unit/test_crypto_elliptic_curve.py +++ b/test/unit/aws_encryption_sdk/internal/crypto/test_elliptic_curve.py @@ -17,7 +17,6 @@ from cryptography.hazmat.primitives.asymmetric import ec from cryptography.utils import InterfaceNotImplemented from mock import MagicMock, sentinel -from pytest_mock import mocker # noqa pylint: disable=unused-import import aws_encryption_sdk.internal.crypto.elliptic_curve from aws_encryption_sdk.exceptions import NotSupportedError @@ -30,7 +29,6 @@ _ECCCurveParameters, generate_ecc_signing_key, ) - from .test_crypto import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_crypto_wrapping_keys.py b/test/unit/aws_encryption_sdk/internal/crypto/test_wrapping_keys.py similarity index 100% rename from test/unit/test_crypto_wrapping_keys.py rename to test/unit/aws_encryption_sdk/internal/crypto/test_wrapping_keys.py diff --git a/test/unit/test_deserialize.py b/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py similarity index 99% rename from test/unit/test_deserialize.py rename to test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py index 8a96ea4ca..d2cbcd219 100644 --- a/test/unit/test_deserialize.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.identifiers import AlgorithmSuite from aws_encryption_sdk.internal.structures import EncryptedData -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_encryption_context.py b/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py similarity index 99% rename from test/unit/test_encryption_context.py rename to test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py index 187365783..bf3b0112b 100644 --- a/test/unit/test_encryption_context.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.exceptions import SerializationError from aws_encryption_sdk.identifiers import ContentAADString -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_serialize.py b/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py similarity index 99% rename from test/unit/test_serialize.py rename to test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py index 511048d80..2dfe12b78 100644 --- a/test/unit/test_serialize.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.internal.structures import EncryptedData from aws_encryption_sdk.structures import EncryptedDataKey, MasterKeyInfo -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_defaults.py b/test/unit/aws_encryption_sdk/internal/test_defaults.py similarity index 100% rename from test/unit/test_defaults.py rename to test/unit/aws_encryption_sdk/internal/test_defaults.py diff --git a/test/unit/test_internal_structures.py b/test/unit/aws_encryption_sdk/internal/test_structures.py similarity index 97% rename from test/unit/test_internal_structures.py rename to test/unit/aws_encryption_sdk/internal/test_structures.py index d57166982..baa12f189 100644 --- a/test/unit/test_internal_structures.py +++ b/test/unit/aws_encryption_sdk/internal/test_structures.py @@ -21,7 +21,7 @@ MessageNoFrameBody, ) -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_util_str_ops.py b/test/unit/aws_encryption_sdk/internal/utils/test_str_ops.py similarity index 100% rename from test/unit/test_util_str_ops.py rename to test/unit/aws_encryption_sdk/internal/utils/test_str_ops.py diff --git a/test/unit/test_util_streams.py b/test/unit/aws_encryption_sdk/internal/utils/test_streams.py similarity index 96% rename from test/unit/test_util_streams.py rename to test/unit/aws_encryption_sdk/internal/utils/test_streams.py index ab7b05152..6db6bda99 100644 --- a/test/unit/test_util_streams.py +++ b/test/unit/aws_encryption_sdk/internal/utils/test_streams.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.str_ops import to_bytes, to_str from aws_encryption_sdk.internal.utils.streams import InsistentReaderBytesIO, ROStream, TeeStream -from .unit_test_utils import ExactlyTwoReads, NothingButRead, SometimesIncompleteReaderIO +from ....unit_test_utils import ExactlyTwoReads, NothingButRead, SometimesIncompleteReaderIO pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_utils.py b/test/unit/aws_encryption_sdk/internal/utils/test_utils.py similarity index 99% rename from test/unit/test_utils.py rename to test/unit/aws_encryption_sdk/internal/utils/test_utils.py index b83e5de1d..bce43249a 100644 --- a/test/unit/test_utils.py +++ b/test/unit/aws_encryption_sdk/internal/utils/test_utils.py @@ -24,8 +24,8 @@ from aws_encryption_sdk.keyrings.base import EncryptedDataKey from aws_encryption_sdk.structures import DataKey, MasterKeyInfo, RawDataKey -from .test_values import VALUES -from .unit_test_utils import assert_prepped_stream_identity +from ....test_values import VALUES +from ....unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/__init__.py b/test/unit/aws_encryption_sdk/key_providers/base/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/key_providers/base/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_providers_base_master_key.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py similarity index 99% rename from test/unit/test_providers_base_master_key.py rename to test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py index 26a90ced8..8045fbed6 100644 --- a/test/unit/test_providers_base_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig, MasterKeyProvider from aws_encryption_sdk.structures import MasterKeyInfo -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_base_master_key_config.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py similarity index 96% rename from test/unit/test_providers_base_master_key_config.py rename to test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py index 8b6c8731a..c4692ce55 100644 --- a/test/unit/test_providers_base_master_key_config.py +++ b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py @@ -15,7 +15,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_base_master_key_provider.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py similarity index 99% rename from test/unit/test_providers_base_master_key_provider.py rename to test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py index 44385ea17..7c3146e52 100644 --- a/test/unit/test_providers_base_master_key_provider.py +++ b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py @@ -23,7 +23,7 @@ ) from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_base_master_key_provider_config.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider_config.py similarity index 100% rename from test/unit/test_providers_base_master_key_provider_config.py rename to test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider_config.py diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/__init__.py b/test/unit/aws_encryption_sdk/key_providers/kms/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/key_providers/kms/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_providers_kms_master_key.py b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py similarity index 99% rename from test/unit/test_providers_kms_master_key.py rename to test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py index c0ab9a968..cd113725e 100644 --- a/test/unit/test_providers_kms_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.key_providers.kms import KMSMasterKey, KMSMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_kms_master_key_config.py b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py similarity index 96% rename from test/unit/test_providers_kms_master_key_config.py rename to test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py index 1501c951f..850b16e37 100644 --- a/test/unit/test_providers_kms_master_key_config.py +++ b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py @@ -17,7 +17,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig from aws_encryption_sdk.key_providers.kms import _PROVIDER_ID, KMSMasterKeyConfig -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_kms_master_key_provider.py b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider.py similarity index 100% rename from test/unit/test_providers_kms_master_key_provider.py rename to test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider.py diff --git a/test/unit/test_providers_kms_master_key_provider_config.py b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py similarity index 97% rename from test/unit/test_providers_kms_master_key_provider_config.py rename to test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py index affa74102..721c5e943 100644 --- a/test/unit/test_providers_kms_master_key_provider_config.py +++ b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py @@ -17,7 +17,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProviderConfig from aws_encryption_sdk.key_providers.kms import KMSMasterKeyProviderConfig -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/__init__.py b/test/unit/aws_encryption_sdk/key_providers/raw/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/key_providers/raw/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_providers_raw_master_key.py b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py similarity index 99% rename from test/unit/test_providers_raw_master_key.py rename to test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py index 9abcd14c6..b78481e4b 100644 --- a/test/unit/test_providers_raw_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.raw import RawMasterKey, RawMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, RawDataKey -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_raw_master_key_config.py b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py similarity index 96% rename from test/unit/test_providers_raw_master_key_config.py rename to test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py index d06feae87..ec8c154d8 100644 --- a/test/unit/test_providers_raw_master_key_config.py +++ b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig from aws_encryption_sdk.key_providers.raw import RawMasterKeyConfig -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_providers_raw_master_key_provider.py b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py similarity index 98% rename from test/unit/test_providers_raw_master_key_provider.py rename to test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py index 5128b1e22..19f398a8c 100644 --- a/test/unit/test_providers_raw_master_key_provider.py +++ b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig from aws_encryption_sdk.key_providers.raw import RawMasterKeyProvider -from .test_values import VALUES +from ....test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_material_managers_base.py b/test/unit/aws_encryption_sdk/materials_managers/test_base.py similarity index 100% rename from test/unit/test_material_managers_base.py rename to test/unit/aws_encryption_sdk/materials_managers/test_base.py diff --git a/test/unit/test_material_managers_caching.py b/test/unit/aws_encryption_sdk/materials_managers/test_caching.py similarity index 100% rename from test/unit/test_material_managers_caching.py rename to test/unit/aws_encryption_sdk/materials_managers/test_caching.py diff --git a/test/unit/test_material_managers_default.py b/test/unit/aws_encryption_sdk/materials_managers/test_default.py similarity index 100% rename from test/unit/test_material_managers_default.py rename to test/unit/aws_encryption_sdk/materials_managers/test_default.py diff --git a/test/unit/test_material_managers.py b/test/unit/aws_encryption_sdk/materials_managers/test_material_managers.py similarity index 100% rename from test/unit/test_material_managers.py rename to test/unit/aws_encryption_sdk/materials_managers/test_material_managers.py diff --git a/test/unit/aws_encryption_sdk/streaming_client/__init__.py b/test/unit/aws_encryption_sdk/streaming_client/__init__.py new file mode 100644 index 000000000..ad0e71d6c --- /dev/null +++ b/test/unit/aws_encryption_sdk/streaming_client/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/test_streaming_client_configs.py b/test/unit/aws_encryption_sdk/streaming_client/test_configs.py similarity index 98% rename from test/unit/test_streaming_client_configs.py rename to test/unit/aws_encryption_sdk/streaming_client/test_configs.py index 98e5cb13c..2c550d435 100644 --- a/test/unit/test_streaming_client_configs.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_configs.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.materials_managers.default import DefaultCryptoMaterialsManager from aws_encryption_sdk.streaming_client import DecryptorConfig, EncryptorConfig, _ClientConfig -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs, build_valid_kwargs_list +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs, build_valid_kwargs_list pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_streaming_client_encryption_stream.py b/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py similarity index 99% rename from test/unit/test_streaming_client_encryption_stream.py rename to test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py index e3a06347a..4c468139b 100644 --- a/test/unit/test_streaming_client_encryption_stream.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py @@ -23,8 +23,8 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider from aws_encryption_sdk.streaming_client import _ClientConfig, _EncryptionStream -from .test_values import VALUES -from .unit_test_utils import assert_prepped_stream_identity +from ...test_values import VALUES +from ...unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_streaming_client_stream_decryptor.py b/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py similarity index 99% rename from test/unit/test_streaming_client_stream_decryptor.py rename to test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py index 6a3ccb56d..7f5846fec 100644 --- a/test/unit/test_streaming_client_stream_decryptor.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager from aws_encryption_sdk.streaming_client import StreamDecryptor -from .test_values import VALUES +from ...test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_streaming_client_stream_encryptor.py b/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py similarity index 99% rename from test/unit/test_streaming_client_stream_encryptor.py rename to test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py index 5cb2b8e37..f1ef9f2af 100644 --- a/test/unit/test_streaming_client_stream_encryptor.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py @@ -30,7 +30,7 @@ from aws_encryption_sdk.streaming_client import StreamEncryptor from aws_encryption_sdk.structures import MessageHeader -from .test_values import VALUES +from ...test_values import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_aws_encryption_sdk.py b/test/unit/aws_encryption_sdk/test_client.py similarity index 100% rename from test/unit/test_aws_encryption_sdk.py rename to test/unit/aws_encryption_sdk/test_client.py diff --git a/test/unit/test_identifiers.py b/test/unit/aws_encryption_sdk/test_identifiers.py similarity index 100% rename from test/unit/test_identifiers.py rename to test/unit/aws_encryption_sdk/test_identifiers.py diff --git a/test/unit/test_structures.py b/test/unit/aws_encryption_sdk/test_structures.py similarity index 98% rename from test/unit/test_structures.py rename to test/unit/aws_encryption_sdk/test_structures.py index e1070c574..0949b5934 100644 --- a/test/unit/test_structures.py +++ b/test/unit/aws_encryption_sdk/test_structures.py @@ -16,7 +16,7 @@ from aws_encryption_sdk.identifiers import Algorithm, ContentType, ObjectType, SerializationVersion from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, MessageHeader, RawDataKey -from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ..unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] From 330ce5bc8abb55ccd3baa7a5781b92287ffdbb88 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 14:31:52 -0700 Subject: [PATCH 08/13] rename test_values to vectors to avoid it being confused for a test file --- .../aws_encryption_sdk/internal/formatting/test_deserialize.py | 2 +- .../internal/formatting/test_encryption_context.py | 2 +- .../aws_encryption_sdk/internal/formatting/test_serialize.py | 2 +- test/unit/aws_encryption_sdk/internal/utils/test_utils.py | 2 +- .../key_providers/base/test_base_master_key.py | 2 +- .../key_providers/base/test_base_master_key_provider.py | 2 +- .../aws_encryption_sdk/key_providers/kms/test_kms_master_key.py | 2 +- .../aws_encryption_sdk/key_providers/raw/test_raw_master_key.py | 2 +- .../key_providers/raw/test_raw_master_key_provider.py | 2 +- test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py | 2 +- .../streaming_client/test_encryption_stream.py | 2 +- .../streaming_client/test_stream_decryptor.py | 2 +- .../streaming_client/test_stream_encryptor.py | 2 +- test/unit/{test_values.py => vectors.py} | 0 14 files changed, 13 insertions(+), 13 deletions(-) rename test/unit/{test_values.py => vectors.py} (100%) diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py b/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py index d2cbcd219..4055cd205 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.identifiers import AlgorithmSuite from aws_encryption_sdk.internal.structures import EncryptedData -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py b/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py index bf3b0112b..ece235c9d 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.exceptions import SerializationError from aws_encryption_sdk.identifiers import ContentAADString -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py b/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py index 2dfe12b78..4e0dc12c3 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py +++ b/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.internal.structures import EncryptedData from aws_encryption_sdk.structures import EncryptedDataKey, MasterKeyInfo -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/utils/test_utils.py b/test/unit/aws_encryption_sdk/internal/utils/test_utils.py index bce43249a..f9bdc0c83 100644 --- a/test/unit/aws_encryption_sdk/internal/utils/test_utils.py +++ b/test/unit/aws_encryption_sdk/internal/utils/test_utils.py @@ -24,7 +24,7 @@ from aws_encryption_sdk.keyrings.base import EncryptedDataKey from aws_encryption_sdk.structures import DataKey, MasterKeyInfo, RawDataKey -from ....test_values import VALUES +from ....vectors import VALUES from ....unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py index 8045fbed6..28646f6d0 100644 --- a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig, MasterKeyProvider from aws_encryption_sdk.structures import MasterKeyInfo -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py index 7c3146e52..f3b1e2d31 100644 --- a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py +++ b/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py @@ -23,7 +23,7 @@ ) from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py index cd113725e..4ee4a925c 100644 --- a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.key_providers.kms import KMSMasterKey, KMSMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py index b78481e4b..ec87b5fbb 100644 --- a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py +++ b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.raw import RawMasterKey, RawMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, RawDataKey -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py index 19f398a8c..4ad91079c 100644 --- a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py +++ b/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig from aws_encryption_sdk.key_providers.raw import RawMasterKeyProvider -from ....test_values import VALUES +from ....vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py index b2972cbdc..c07c3abc7 100644 --- a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py +++ b/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.keyrings.base import Keyring from aws_encryption_sdk.keyrings.raw import RawRSAKeyring -from ....test_values import VALUES +from ....vectors import VALUES from ....unit_test_utils import ( _BACKEND, _DATA_KEY, diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py b/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py index 4c468139b..dfed09138 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider from aws_encryption_sdk.streaming_client import _ClientConfig, _EncryptionStream -from ...test_values import VALUES +from ...vectors import VALUES from ...unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py b/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py index 7f5846fec..74c814f32 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager from aws_encryption_sdk.streaming_client import StreamDecryptor -from ...test_values import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py b/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py index f1ef9f2af..a23a23c31 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py +++ b/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py @@ -30,7 +30,7 @@ from aws_encryption_sdk.streaming_client import StreamEncryptor from aws_encryption_sdk.structures import MessageHeader -from ...test_values import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/test_values.py b/test/unit/vectors.py similarity index 100% rename from test/unit/test_values.py rename to test/unit/vectors.py From 6d31a4e17f93a231cc1aee531642cbea5fb60cde Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 20:24:46 -0700 Subject: [PATCH 09/13] remove aws_encryption_sdk from functional test namespace --- test/functional/__init__.py | 3 ++- .../aws_encryption_sdk/keyrings/raw/__init__.py | 13 ------------- .../{aws_encryption_sdk => internal}/__init__.py | 0 .../internal => internal/crypto}/__init__.py | 0 .../internal/crypto/test_crypto.py | 0 .../internal/crypto/test_iv.py | 0 .../key_providers/__init__.py | 0 .../key_providers/test_base.py | 0 .../internal/crypto => keyrings}/__init__.py | 0 .../keyrings => keyrings/raw}/__init__.py | 0 .../keyrings/raw/test_raw_aes.py | 0 .../keyrings/raw/test_raw_rsa.py | 0 .../{aws_encryption_sdk => }/keyrings/test_multi.py | 0 .../{aws_encryption_sdk => }/test_client.py | 0 14 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 test/functional/aws_encryption_sdk/keyrings/raw/__init__.py rename test/functional/{aws_encryption_sdk => internal}/__init__.py (100%) rename test/functional/{aws_encryption_sdk/internal => internal/crypto}/__init__.py (100%) rename test/functional/{aws_encryption_sdk => }/internal/crypto/test_crypto.py (100%) rename test/functional/{aws_encryption_sdk => }/internal/crypto/test_iv.py (100%) rename test/functional/{aws_encryption_sdk => }/key_providers/__init__.py (100%) rename test/functional/{aws_encryption_sdk => }/key_providers/test_base.py (100%) rename test/functional/{aws_encryption_sdk/internal/crypto => keyrings}/__init__.py (100%) rename test/functional/{aws_encryption_sdk/keyrings => keyrings/raw}/__init__.py (100%) rename test/functional/{aws_encryption_sdk => }/keyrings/raw/test_raw_aes.py (100%) rename test/functional/{aws_encryption_sdk => }/keyrings/raw/test_raw_rsa.py (100%) rename test/functional/{aws_encryption_sdk => }/keyrings/test_multi.py (100%) rename test/functional/{aws_encryption_sdk => }/test_client.py (100%) diff --git a/test/functional/__init__.py b/test/functional/__init__.py index 53a960891..ad0e71d6c 100644 --- a/test/functional/__init__.py +++ b/test/functional/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -10,3 +10,4 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py b/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py deleted file mode 100644 index ad0e71d6c..000000000 --- a/test/functional/aws_encryption_sdk/keyrings/raw/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -"""Dummy stub to make linters work better.""" diff --git a/test/functional/aws_encryption_sdk/__init__.py b/test/functional/internal/__init__.py similarity index 100% rename from test/functional/aws_encryption_sdk/__init__.py rename to test/functional/internal/__init__.py diff --git a/test/functional/aws_encryption_sdk/internal/__init__.py b/test/functional/internal/crypto/__init__.py similarity index 100% rename from test/functional/aws_encryption_sdk/internal/__init__.py rename to test/functional/internal/crypto/__init__.py diff --git a/test/functional/aws_encryption_sdk/internal/crypto/test_crypto.py b/test/functional/internal/crypto/test_crypto.py similarity index 100% rename from test/functional/aws_encryption_sdk/internal/crypto/test_crypto.py rename to test/functional/internal/crypto/test_crypto.py diff --git a/test/functional/aws_encryption_sdk/internal/crypto/test_iv.py b/test/functional/internal/crypto/test_iv.py similarity index 100% rename from test/functional/aws_encryption_sdk/internal/crypto/test_iv.py rename to test/functional/internal/crypto/test_iv.py diff --git a/test/functional/aws_encryption_sdk/key_providers/__init__.py b/test/functional/key_providers/__init__.py similarity index 100% rename from test/functional/aws_encryption_sdk/key_providers/__init__.py rename to test/functional/key_providers/__init__.py diff --git a/test/functional/aws_encryption_sdk/key_providers/test_base.py b/test/functional/key_providers/test_base.py similarity index 100% rename from test/functional/aws_encryption_sdk/key_providers/test_base.py rename to test/functional/key_providers/test_base.py diff --git a/test/functional/aws_encryption_sdk/internal/crypto/__init__.py b/test/functional/keyrings/__init__.py similarity index 100% rename from test/functional/aws_encryption_sdk/internal/crypto/__init__.py rename to test/functional/keyrings/__init__.py diff --git a/test/functional/aws_encryption_sdk/keyrings/__init__.py b/test/functional/keyrings/raw/__init__.py similarity index 100% rename from test/functional/aws_encryption_sdk/keyrings/__init__.py rename to test/functional/keyrings/raw/__init__.py diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py b/test/functional/keyrings/raw/test_raw_aes.py similarity index 100% rename from test/functional/aws_encryption_sdk/keyrings/raw/test_raw_aes.py rename to test/functional/keyrings/raw/test_raw_aes.py diff --git a/test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py b/test/functional/keyrings/raw/test_raw_rsa.py similarity index 100% rename from test/functional/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py rename to test/functional/keyrings/raw/test_raw_rsa.py diff --git a/test/functional/aws_encryption_sdk/keyrings/test_multi.py b/test/functional/keyrings/test_multi.py similarity index 100% rename from test/functional/aws_encryption_sdk/keyrings/test_multi.py rename to test/functional/keyrings/test_multi.py diff --git a/test/functional/aws_encryption_sdk/test_client.py b/test/functional/test_client.py similarity index 100% rename from test/functional/aws_encryption_sdk/test_client.py rename to test/functional/test_client.py From 2ba5f5e27cf22132e92a1d4ab048563dfd8124f9 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 20:26:22 -0700 Subject: [PATCH 10/13] remove aws_encryption_sdk from integration test namespace --- test/integration/__init__.py | 3 ++- test/integration/aws_encryption_sdk/__init__.py | 13 ------------- .../{aws_encryption_sdk => }/test_client.py | 2 +- .../{aws_encryption_sdk => }/test_thread_safety.py | 2 +- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 test/integration/aws_encryption_sdk/__init__.py rename test/integration/{aws_encryption_sdk => }/test_client.py (99%) rename test/integration/{aws_encryption_sdk => }/test_thread_safety.py (98%) diff --git a/test/integration/__init__.py b/test/integration/__init__.py index 53a960891..ad0e71d6c 100644 --- a/test/integration/__init__.py +++ b/test/integration/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -10,3 +10,4 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/integration/aws_encryption_sdk/__init__.py b/test/integration/aws_encryption_sdk/__init__.py deleted file mode 100644 index ad0e71d6c..000000000 --- a/test/integration/aws_encryption_sdk/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -"""Dummy stub to make linters work better.""" diff --git a/test/integration/aws_encryption_sdk/test_client.py b/test/integration/test_client.py similarity index 99% rename from test/integration/aws_encryption_sdk/test_client.py rename to test/integration/test_client.py index c536f46c4..26df431dc 100644 --- a/test/integration/aws_encryption_sdk/test_client.py +++ b/test/integration/test_client.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.identifiers import USER_AGENT_SUFFIX, Algorithm from aws_encryption_sdk.key_providers.kms import KMSMasterKey, KMSMasterKeyProvider -from ..integration_test_utils import ( +from .integration_test_utils import ( get_cmk_arn, setup_kms_master_key_provider, setup_kms_master_key_provider_with_botocore_session, diff --git a/test/integration/aws_encryption_sdk/test_thread_safety.py b/test/integration/test_thread_safety.py similarity index 98% rename from test/integration/aws_encryption_sdk/test_thread_safety.py rename to test/integration/test_thread_safety.py index 6d4fb796a..006856801 100644 --- a/test/integration/aws_encryption_sdk/test_thread_safety.py +++ b/test/integration/test_thread_safety.py @@ -23,7 +23,7 @@ import aws_encryption_sdk -from ..integration_test_utils import get_cmk_arn, setup_kms_master_key_provider +from .integration_test_utils import get_cmk_arn, setup_kms_master_key_provider pytestmark = [pytest.mark.integ] From 641c2dd9497a71a75e018a8c6d8f89fe689a5fd3 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 20:35:58 -0700 Subject: [PATCH 11/13] remove aws_encryption_sdk from unit test namespace --- test/unit/__init__.py | 3 ++- .../aws_encryption_sdk/streaming_client/__init__.py | 13 ------------- .../unit/{aws_encryption_sdk => caches}/__init__.py | 0 .../{aws_encryption_sdk => }/caches/test_base.py | 0 .../{aws_encryption_sdk => }/caches/test_caches.py | 0 .../caches/test_crypto_cache_entry.py | 0 .../{aws_encryption_sdk => }/caches/test_local.py | 0 .../{aws_encryption_sdk => }/caches/test_null.py | 0 .../caches => internal}/__init__.py | 0 .../internal => internal/crypto}/__init__.py | 0 .../crypto/authentication}/__init__.py | 0 .../authentication/test_prehashing_authenticator.py | 0 .../internal/crypto/authentication/test_signer.py | 0 .../internal/crypto/authentication/test_verifier.py | 0 .../crypto/encryption}/__init__.py | 0 .../internal/crypto/encryption/test_decryptor.py | 0 .../internal/crypto/encryption/test_encryptor.py | 0 .../internal/crypto/test_crypto.py | 0 .../internal/crypto/test_data_keys.py | 0 .../internal/crypto/test_elliptic_curve.py | 0 .../internal/crypto/test_wrapping_keys.py | 0 .../encryption => internal/formatting}/__init__.py | 0 .../internal/formatting/test_deserialize.py | 2 +- .../internal/formatting/test_encryption_context.py | 2 +- .../internal/formatting/test_serialize.py | 2 +- .../internal/test_defaults.py | 0 .../internal/test_structures.py | 2 +- .../formatting => internal/utils}/__init__.py | 0 .../internal/utils/test_str_ops.py | 0 .../internal/utils/test_streams.py | 2 +- .../internal/utils/test_utils.py | 4 ++-- .../internal/utils => key_providers}/__init__.py | 0 .../base}/__init__.py | 0 .../key_providers/base/test_base_master_key.py | 2 +- .../base/test_base_master_key_config.py | 2 +- .../base/test_base_master_key_provider.py | 2 +- .../base/test_base_master_key_provider_config.py | 0 .../base => key_providers/kms}/__init__.py | 0 .../key_providers/kms/test_kms_master_key.py | 2 +- .../key_providers/kms/test_kms_master_key_config.py | 2 +- .../kms/test_kms_master_key_provider.py | 0 .../kms/test_kms_master_key_provider_config.py | 2 +- .../kms => key_providers/raw}/__init__.py | 0 .../key_providers/raw/test_raw_master_key.py | 2 +- .../key_providers/raw/test_raw_master_key_config.py | 2 +- .../raw/test_raw_master_key_provider.py | 2 +- .../key_providers/raw => keyrings}/__init__.py | 0 .../keyrings => keyrings/raw}/__init__.py | 0 .../keyrings/raw/test_raw_aes.py | 2 +- .../keyrings/raw/test_raw_rsa.py | 4 ++-- .../{aws_encryption_sdk => }/keyrings/test_base.py | 0 .../{aws_encryption_sdk => }/keyrings/test_multi.py | 2 +- .../keyrings/raw => materials_managers}/__init__.py | 0 .../materials_managers/test_base.py | 0 .../materials_managers/test_caching.py | 0 .../materials_managers/test_default.py | 0 .../materials_managers/test_material_managers.py | 0 .../__init__.py | 0 .../streaming_client/test_configs.py | 2 +- .../streaming_client/test_encryption_stream.py | 4 ++-- .../streaming_client/test_stream_decryptor.py | 2 +- .../streaming_client/test_stream_encryptor.py | 2 +- test/unit/{aws_encryption_sdk => }/test_client.py | 0 .../{aws_encryption_sdk => }/test_identifiers.py | 0 .../{aws_encryption_sdk => }/test_structures.py | 2 +- 65 files changed, 28 insertions(+), 40 deletions(-) delete mode 100644 test/unit/aws_encryption_sdk/streaming_client/__init__.py rename test/unit/{aws_encryption_sdk => caches}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/caches/test_base.py (100%) rename test/unit/{aws_encryption_sdk => }/caches/test_caches.py (100%) rename test/unit/{aws_encryption_sdk => }/caches/test_crypto_cache_entry.py (100%) rename test/unit/{aws_encryption_sdk => }/caches/test_local.py (100%) rename test/unit/{aws_encryption_sdk => }/caches/test_null.py (100%) rename test/unit/{aws_encryption_sdk/caches => internal}/__init__.py (100%) rename test/unit/{aws_encryption_sdk/internal => internal/crypto}/__init__.py (100%) rename test/unit/{aws_encryption_sdk/internal/crypto => internal/crypto/authentication}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/authentication/test_prehashing_authenticator.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/authentication/test_signer.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/authentication/test_verifier.py (100%) rename test/unit/{aws_encryption_sdk/internal/crypto/authentication => internal/crypto/encryption}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/encryption/test_decryptor.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/encryption/test_encryptor.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/test_crypto.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/test_data_keys.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/test_elliptic_curve.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/crypto/test_wrapping_keys.py (100%) rename test/unit/{aws_encryption_sdk/internal/crypto/encryption => internal/formatting}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/formatting/test_deserialize.py (99%) rename test/unit/{aws_encryption_sdk => }/internal/formatting/test_encryption_context.py (99%) rename test/unit/{aws_encryption_sdk => }/internal/formatting/test_serialize.py (99%) rename test/unit/{aws_encryption_sdk => }/internal/test_defaults.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/test_structures.py (97%) rename test/unit/{aws_encryption_sdk/internal/formatting => internal/utils}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/utils/test_str_ops.py (100%) rename test/unit/{aws_encryption_sdk => }/internal/utils/test_streams.py (96%) rename test/unit/{aws_encryption_sdk => }/internal/utils/test_utils.py (99%) rename test/unit/{aws_encryption_sdk/internal/utils => key_providers}/__init__.py (100%) rename test/unit/{aws_encryption_sdk/key_providers => key_providers/base}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/key_providers/base/test_base_master_key.py (99%) rename test/unit/{aws_encryption_sdk => }/key_providers/base/test_base_master_key_config.py (96%) rename test/unit/{aws_encryption_sdk => }/key_providers/base/test_base_master_key_provider.py (99%) rename test/unit/{aws_encryption_sdk => }/key_providers/base/test_base_master_key_provider_config.py (100%) rename test/unit/{aws_encryption_sdk/key_providers/base => key_providers/kms}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/key_providers/kms/test_kms_master_key.py (99%) rename test/unit/{aws_encryption_sdk => }/key_providers/kms/test_kms_master_key_config.py (96%) rename test/unit/{aws_encryption_sdk => }/key_providers/kms/test_kms_master_key_provider.py (100%) rename test/unit/{aws_encryption_sdk => }/key_providers/kms/test_kms_master_key_provider_config.py (97%) rename test/unit/{aws_encryption_sdk/key_providers/kms => key_providers/raw}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/key_providers/raw/test_raw_master_key.py (99%) rename test/unit/{aws_encryption_sdk => }/key_providers/raw/test_raw_master_key_config.py (96%) rename test/unit/{aws_encryption_sdk => }/key_providers/raw/test_raw_master_key_provider.py (98%) rename test/unit/{aws_encryption_sdk/key_providers/raw => keyrings}/__init__.py (100%) rename test/unit/{aws_encryption_sdk/keyrings => keyrings/raw}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/keyrings/raw/test_raw_aes.py (99%) rename test/unit/{aws_encryption_sdk => }/keyrings/raw/test_raw_rsa.py (99%) rename test/unit/{aws_encryption_sdk => }/keyrings/test_base.py (100%) rename test/unit/{aws_encryption_sdk => }/keyrings/test_multi.py (99%) rename test/unit/{aws_encryption_sdk/keyrings/raw => materials_managers}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/materials_managers/test_base.py (100%) rename test/unit/{aws_encryption_sdk => }/materials_managers/test_caching.py (100%) rename test/unit/{aws_encryption_sdk => }/materials_managers/test_default.py (100%) rename test/unit/{aws_encryption_sdk => }/materials_managers/test_material_managers.py (100%) rename test/unit/{aws_encryption_sdk/materials_managers => streaming_client}/__init__.py (100%) rename test/unit/{aws_encryption_sdk => }/streaming_client/test_configs.py (98%) rename test/unit/{aws_encryption_sdk => }/streaming_client/test_encryption_stream.py (99%) rename test/unit/{aws_encryption_sdk => }/streaming_client/test_stream_decryptor.py (99%) rename test/unit/{aws_encryption_sdk => }/streaming_client/test_stream_encryptor.py (99%) rename test/unit/{aws_encryption_sdk => }/test_client.py (100%) rename test/unit/{aws_encryption_sdk => }/test_identifiers.py (100%) rename test/unit/{aws_encryption_sdk => }/test_structures.py (98%) diff --git a/test/unit/__init__.py b/test/unit/__init__.py index 53a960891..ad0e71d6c 100644 --- a/test/unit/__init__.py +++ b/test/unit/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -10,3 +10,4 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. +"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/streaming_client/__init__.py b/test/unit/aws_encryption_sdk/streaming_client/__init__.py deleted file mode 100644 index ad0e71d6c..000000000 --- a/test/unit/aws_encryption_sdk/streaming_client/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -"""Dummy stub to make linters work better.""" diff --git a/test/unit/aws_encryption_sdk/__init__.py b/test/unit/caches/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/__init__.py rename to test/unit/caches/__init__.py diff --git a/test/unit/aws_encryption_sdk/caches/test_base.py b/test/unit/caches/test_base.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/test_base.py rename to test/unit/caches/test_base.py diff --git a/test/unit/aws_encryption_sdk/caches/test_caches.py b/test/unit/caches/test_caches.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/test_caches.py rename to test/unit/caches/test_caches.py diff --git a/test/unit/aws_encryption_sdk/caches/test_crypto_cache_entry.py b/test/unit/caches/test_crypto_cache_entry.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/test_crypto_cache_entry.py rename to test/unit/caches/test_crypto_cache_entry.py diff --git a/test/unit/aws_encryption_sdk/caches/test_local.py b/test/unit/caches/test_local.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/test_local.py rename to test/unit/caches/test_local.py diff --git a/test/unit/aws_encryption_sdk/caches/test_null.py b/test/unit/caches/test_null.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/test_null.py rename to test/unit/caches/test_null.py diff --git a/test/unit/aws_encryption_sdk/caches/__init__.py b/test/unit/internal/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/caches/__init__.py rename to test/unit/internal/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/__init__.py b/test/unit/internal/crypto/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/__init__.py rename to test/unit/internal/crypto/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/__init__.py b/test/unit/internal/crypto/authentication/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/__init__.py rename to test/unit/internal/crypto/authentication/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_prehashing_authenticator.py b/test/unit/internal/crypto/authentication/test_prehashing_authenticator.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/authentication/test_prehashing_authenticator.py rename to test/unit/internal/crypto/authentication/test_prehashing_authenticator.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_signer.py b/test/unit/internal/crypto/authentication/test_signer.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/authentication/test_signer.py rename to test/unit/internal/crypto/authentication/test_signer.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/authentication/test_verifier.py b/test/unit/internal/crypto/authentication/test_verifier.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/authentication/test_verifier.py rename to test/unit/internal/crypto/authentication/test_verifier.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py b/test/unit/internal/crypto/encryption/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/authentication/__init__.py rename to test/unit/internal/crypto/encryption/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/encryption/test_decryptor.py b/test/unit/internal/crypto/encryption/test_decryptor.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/encryption/test_decryptor.py rename to test/unit/internal/crypto/encryption/test_decryptor.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/encryption/test_encryptor.py b/test/unit/internal/crypto/encryption/test_encryptor.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/encryption/test_encryptor.py rename to test/unit/internal/crypto/encryption/test_encryptor.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/test_crypto.py b/test/unit/internal/crypto/test_crypto.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/test_crypto.py rename to test/unit/internal/crypto/test_crypto.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/test_data_keys.py b/test/unit/internal/crypto/test_data_keys.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/test_data_keys.py rename to test/unit/internal/crypto/test_data_keys.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/test_elliptic_curve.py b/test/unit/internal/crypto/test_elliptic_curve.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/test_elliptic_curve.py rename to test/unit/internal/crypto/test_elliptic_curve.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/test_wrapping_keys.py b/test/unit/internal/crypto/test_wrapping_keys.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/test_wrapping_keys.py rename to test/unit/internal/crypto/test_wrapping_keys.py diff --git a/test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py b/test/unit/internal/formatting/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/crypto/encryption/__init__.py rename to test/unit/internal/formatting/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py b/test/unit/internal/formatting/test_deserialize.py similarity index 99% rename from test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py rename to test/unit/internal/formatting/test_deserialize.py index 4055cd205..d19093320 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_deserialize.py +++ b/test/unit/internal/formatting/test_deserialize.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.identifiers import AlgorithmSuite from aws_encryption_sdk.internal.structures import EncryptedData -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py b/test/unit/internal/formatting/test_encryption_context.py similarity index 99% rename from test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py rename to test/unit/internal/formatting/test_encryption_context.py index ece235c9d..443df4065 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_encryption_context.py +++ b/test/unit/internal/formatting/test_encryption_context.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.exceptions import SerializationError from aws_encryption_sdk.identifiers import ContentAADString -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py b/test/unit/internal/formatting/test_serialize.py similarity index 99% rename from test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py rename to test/unit/internal/formatting/test_serialize.py index 4e0dc12c3..8dbe9bd05 100644 --- a/test/unit/aws_encryption_sdk/internal/formatting/test_serialize.py +++ b/test/unit/internal/formatting/test_serialize.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.internal.structures import EncryptedData from aws_encryption_sdk.structures import EncryptedDataKey, MasterKeyInfo -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/test_defaults.py b/test/unit/internal/test_defaults.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/test_defaults.py rename to test/unit/internal/test_defaults.py diff --git a/test/unit/aws_encryption_sdk/internal/test_structures.py b/test/unit/internal/test_structures.py similarity index 97% rename from test/unit/aws_encryption_sdk/internal/test_structures.py rename to test/unit/internal/test_structures.py index baa12f189..04f4e737a 100644 --- a/test/unit/aws_encryption_sdk/internal/test_structures.py +++ b/test/unit/internal/test_structures.py @@ -21,7 +21,7 @@ MessageNoFrameBody, ) -from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ..unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/formatting/__init__.py b/test/unit/internal/utils/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/formatting/__init__.py rename to test/unit/internal/utils/__init__.py diff --git a/test/unit/aws_encryption_sdk/internal/utils/test_str_ops.py b/test/unit/internal/utils/test_str_ops.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/utils/test_str_ops.py rename to test/unit/internal/utils/test_str_ops.py diff --git a/test/unit/aws_encryption_sdk/internal/utils/test_streams.py b/test/unit/internal/utils/test_streams.py similarity index 96% rename from test/unit/aws_encryption_sdk/internal/utils/test_streams.py rename to test/unit/internal/utils/test_streams.py index 6db6bda99..660e4623c 100644 --- a/test/unit/aws_encryption_sdk/internal/utils/test_streams.py +++ b/test/unit/internal/utils/test_streams.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.str_ops import to_bytes, to_str from aws_encryption_sdk.internal.utils.streams import InsistentReaderBytesIO, ROStream, TeeStream -from ....unit_test_utils import ExactlyTwoReads, NothingButRead, SometimesIncompleteReaderIO +from ...unit_test_utils import ExactlyTwoReads, NothingButRead, SometimesIncompleteReaderIO pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/utils/test_utils.py b/test/unit/internal/utils/test_utils.py similarity index 99% rename from test/unit/aws_encryption_sdk/internal/utils/test_utils.py rename to test/unit/internal/utils/test_utils.py index f9bdc0c83..527d5b0fb 100644 --- a/test/unit/aws_encryption_sdk/internal/utils/test_utils.py +++ b/test/unit/internal/utils/test_utils.py @@ -24,8 +24,8 @@ from aws_encryption_sdk.keyrings.base import EncryptedDataKey from aws_encryption_sdk.structures import DataKey, MasterKeyInfo, RawDataKey -from ....vectors import VALUES -from ....unit_test_utils import assert_prepped_stream_identity +from ...vectors import VALUES +from ...unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/internal/utils/__init__.py b/test/unit/key_providers/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/internal/utils/__init__.py rename to test/unit/key_providers/__init__.py diff --git a/test/unit/aws_encryption_sdk/key_providers/__init__.py b/test/unit/key_providers/base/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/__init__.py rename to test/unit/key_providers/base/__init__.py diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py b/test/unit/key_providers/base/test_base_master_key.py similarity index 99% rename from test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py rename to test/unit/key_providers/base/test_base_master_key.py index 28646f6d0..4ee6c2661 100644 --- a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key.py +++ b/test/unit/key_providers/base/test_base_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig, MasterKeyProvider from aws_encryption_sdk.structures import MasterKeyInfo -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py b/test/unit/key_providers/base/test_base_master_key_config.py similarity index 96% rename from test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py rename to test/unit/key_providers/base/test_base_master_key_config.py index c4692ce55..3eb0ce406 100644 --- a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_config.py +++ b/test/unit/key_providers/base/test_base_master_key_config.py @@ -15,7 +15,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig -from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py b/test/unit/key_providers/base/test_base_master_key_provider.py similarity index 99% rename from test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py rename to test/unit/key_providers/base/test_base_master_key_provider.py index f3b1e2d31..778068dd5 100644 --- a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider.py +++ b/test/unit/key_providers/base/test_base_master_key_provider.py @@ -23,7 +23,7 @@ ) from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider_config.py b/test/unit/key_providers/base/test_base_master_key_provider_config.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/base/test_base_master_key_provider_config.py rename to test/unit/key_providers/base/test_base_master_key_provider_config.py diff --git a/test/unit/aws_encryption_sdk/key_providers/base/__init__.py b/test/unit/key_providers/kms/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/base/__init__.py rename to test/unit/key_providers/kms/__init__.py diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py b/test/unit/key_providers/kms/test_kms_master_key.py similarity index 99% rename from test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py rename to test/unit/key_providers/kms/test_kms_master_key.py index 4ee4a925c..862888ad8 100644 --- a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key.py +++ b/test/unit/key_providers/kms/test_kms_master_key.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.key_providers.kms import KMSMasterKey, KMSMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py b/test/unit/key_providers/kms/test_kms_master_key_config.py similarity index 96% rename from test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py rename to test/unit/key_providers/kms/test_kms_master_key_config.py index 850b16e37..224e43c7c 100644 --- a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_config.py +++ b/test/unit/key_providers/kms/test_kms_master_key_config.py @@ -17,7 +17,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig from aws_encryption_sdk.key_providers.kms import _PROVIDER_ID, KMSMasterKeyConfig -from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider.py b/test/unit/key_providers/kms/test_kms_master_key_provider.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider.py rename to test/unit/key_providers/kms/test_kms_master_key_provider.py diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py b/test/unit/key_providers/kms/test_kms_master_key_provider_config.py similarity index 97% rename from test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py rename to test/unit/key_providers/kms/test_kms_master_key_provider_config.py index 721c5e943..9b8f9fd74 100644 --- a/test/unit/aws_encryption_sdk/key_providers/kms/test_kms_master_key_provider_config.py +++ b/test/unit/key_providers/kms/test_kms_master_key_provider_config.py @@ -17,7 +17,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProviderConfig from aws_encryption_sdk.key_providers.kms import KMSMasterKeyProviderConfig -from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/kms/__init__.py b/test/unit/key_providers/raw/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/kms/__init__.py rename to test/unit/key_providers/raw/__init__.py diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py b/test/unit/key_providers/raw/test_raw_master_key.py similarity index 99% rename from test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py rename to test/unit/key_providers/raw/test_raw_master_key.py index ec87b5fbb..8b9ba658d 100644 --- a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key.py +++ b/test/unit/key_providers/raw/test_raw_master_key.py @@ -20,7 +20,7 @@ from aws_encryption_sdk.key_providers.raw import RawMasterKey, RawMasterKeyConfig from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, RawDataKey -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py b/test/unit/key_providers/raw/test_raw_master_key_config.py similarity index 96% rename from test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py rename to test/unit/key_providers/raw/test_raw_master_key_config.py index ec8c154d8..bbdbc5bef 100644 --- a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_config.py +++ b/test/unit/key_providers/raw/test_raw_master_key_config.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyConfig from aws_encryption_sdk.key_providers.raw import RawMasterKeyConfig -from ....unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py b/test/unit/key_providers/raw/test_raw_master_key_provider.py similarity index 98% rename from test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py rename to test/unit/key_providers/raw/test_raw_master_key_provider.py index 4ad91079c..9205d3563 100644 --- a/test/unit/aws_encryption_sdk/key_providers/raw/test_raw_master_key_provider.py +++ b/test/unit/key_providers/raw/test_raw_master_key_provider.py @@ -18,7 +18,7 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider, MasterKeyProviderConfig from aws_encryption_sdk.key_providers.raw import RawMasterKeyProvider -from ....vectors import VALUES +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/key_providers/raw/__init__.py b/test/unit/keyrings/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/key_providers/raw/__init__.py rename to test/unit/keyrings/__init__.py diff --git a/test/unit/aws_encryption_sdk/keyrings/__init__.py b/test/unit/keyrings/raw/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/keyrings/__init__.py rename to test/unit/keyrings/raw/__init__.py diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py b/test/unit/keyrings/raw/test_raw_aes.py similarity index 99% rename from test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py rename to test/unit/keyrings/raw/test_raw_aes.py index c12a4e565..43de2a697 100644 --- a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_aes.py +++ b/test/unit/keyrings/raw/test_raw_aes.py @@ -27,7 +27,7 @@ from aws_encryption_sdk.materials_managers import EncryptionMaterials from aws_encryption_sdk.structures import MasterKeyInfo -from ....unit_test_utils import ( +from ...unit_test_utils import ( _DATA_KEY, _ENCRYPTED_DATA_KEY_AES, _ENCRYPTED_DATA_KEY_NOT_IN_KEYRING, diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py b/test/unit/keyrings/raw/test_raw_rsa.py similarity index 99% rename from test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py rename to test/unit/keyrings/raw/test_raw_rsa.py index c07c3abc7..748830ab3 100644 --- a/test/unit/aws_encryption_sdk/keyrings/raw/test_raw_rsa.py +++ b/test/unit/keyrings/raw/test_raw_rsa.py @@ -23,8 +23,8 @@ from aws_encryption_sdk.keyrings.base import Keyring from aws_encryption_sdk.keyrings.raw import RawRSAKeyring -from ....vectors import VALUES -from ....unit_test_utils import ( +from ...vectors import VALUES +from ...unit_test_utils import ( _BACKEND, _DATA_KEY, _ENCRYPTED_DATA_KEY_RSA, diff --git a/test/unit/aws_encryption_sdk/keyrings/test_base.py b/test/unit/keyrings/test_base.py similarity index 100% rename from test/unit/aws_encryption_sdk/keyrings/test_base.py rename to test/unit/keyrings/test_base.py diff --git a/test/unit/aws_encryption_sdk/keyrings/test_multi.py b/test/unit/keyrings/test_multi.py similarity index 99% rename from test/unit/aws_encryption_sdk/keyrings/test_multi.py rename to test/unit/keyrings/test_multi.py index 59a87adf3..c0bdc78d9 100644 --- a/test/unit/aws_encryption_sdk/keyrings/test_multi.py +++ b/test/unit/keyrings/test_multi.py @@ -23,7 +23,7 @@ from aws_encryption_sdk.keyrings.multi import MultiKeyring from aws_encryption_sdk.keyrings.raw import RawAESKeyring -from ...unit_test_utils import ( +from ..unit_test_utils import ( IdentityKeyring, OnlyGenerateKeyring, get_decryption_materials_with_data_key, diff --git a/test/unit/aws_encryption_sdk/keyrings/raw/__init__.py b/test/unit/materials_managers/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/keyrings/raw/__init__.py rename to test/unit/materials_managers/__init__.py diff --git a/test/unit/aws_encryption_sdk/materials_managers/test_base.py b/test/unit/materials_managers/test_base.py similarity index 100% rename from test/unit/aws_encryption_sdk/materials_managers/test_base.py rename to test/unit/materials_managers/test_base.py diff --git a/test/unit/aws_encryption_sdk/materials_managers/test_caching.py b/test/unit/materials_managers/test_caching.py similarity index 100% rename from test/unit/aws_encryption_sdk/materials_managers/test_caching.py rename to test/unit/materials_managers/test_caching.py diff --git a/test/unit/aws_encryption_sdk/materials_managers/test_default.py b/test/unit/materials_managers/test_default.py similarity index 100% rename from test/unit/aws_encryption_sdk/materials_managers/test_default.py rename to test/unit/materials_managers/test_default.py diff --git a/test/unit/aws_encryption_sdk/materials_managers/test_material_managers.py b/test/unit/materials_managers/test_material_managers.py similarity index 100% rename from test/unit/aws_encryption_sdk/materials_managers/test_material_managers.py rename to test/unit/materials_managers/test_material_managers.py diff --git a/test/unit/aws_encryption_sdk/materials_managers/__init__.py b/test/unit/streaming_client/__init__.py similarity index 100% rename from test/unit/aws_encryption_sdk/materials_managers/__init__.py rename to test/unit/streaming_client/__init__.py diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_configs.py b/test/unit/streaming_client/test_configs.py similarity index 98% rename from test/unit/aws_encryption_sdk/streaming_client/test_configs.py rename to test/unit/streaming_client/test_configs.py index 2c550d435..a98a38957 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_configs.py +++ b/test/unit/streaming_client/test_configs.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.materials_managers.default import DefaultCryptoMaterialsManager from aws_encryption_sdk.streaming_client import DecryptorConfig, EncryptorConfig, _ClientConfig -from ...unit_test_utils import all_invalid_kwargs, all_valid_kwargs, build_valid_kwargs_list +from ..unit_test_utils import all_invalid_kwargs, all_valid_kwargs, build_valid_kwargs_list pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py b/test/unit/streaming_client/test_encryption_stream.py similarity index 99% rename from test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py rename to test/unit/streaming_client/test_encryption_stream.py index dfed09138..5986d461e 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_encryption_stream.py +++ b/test/unit/streaming_client/test_encryption_stream.py @@ -23,8 +23,8 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider from aws_encryption_sdk.streaming_client import _ClientConfig, _EncryptionStream -from ...vectors import VALUES -from ...unit_test_utils import assert_prepped_stream_identity +from ..vectors import VALUES +from ..unit_test_utils import assert_prepped_stream_identity pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py b/test/unit/streaming_client/test_stream_decryptor.py similarity index 99% rename from test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py rename to test/unit/streaming_client/test_stream_decryptor.py index 74c814f32..06e7f0816 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_stream_decryptor.py +++ b/test/unit/streaming_client/test_stream_decryptor.py @@ -22,7 +22,7 @@ from aws_encryption_sdk.materials_managers.base import CryptoMaterialsManager from aws_encryption_sdk.streaming_client import StreamDecryptor -from ...vectors import VALUES +from ..vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py b/test/unit/streaming_client/test_stream_encryptor.py similarity index 99% rename from test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py rename to test/unit/streaming_client/test_stream_encryptor.py index a23a23c31..42516444a 100644 --- a/test/unit/aws_encryption_sdk/streaming_client/test_stream_encryptor.py +++ b/test/unit/streaming_client/test_stream_encryptor.py @@ -30,7 +30,7 @@ from aws_encryption_sdk.streaming_client import StreamEncryptor from aws_encryption_sdk.structures import MessageHeader -from ...vectors import VALUES +from ..vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/aws_encryption_sdk/test_client.py b/test/unit/test_client.py similarity index 100% rename from test/unit/aws_encryption_sdk/test_client.py rename to test/unit/test_client.py diff --git a/test/unit/aws_encryption_sdk/test_identifiers.py b/test/unit/test_identifiers.py similarity index 100% rename from test/unit/aws_encryption_sdk/test_identifiers.py rename to test/unit/test_identifiers.py diff --git a/test/unit/aws_encryption_sdk/test_structures.py b/test/unit/test_structures.py similarity index 98% rename from test/unit/aws_encryption_sdk/test_structures.py rename to test/unit/test_structures.py index 0949b5934..e1070c574 100644 --- a/test/unit/aws_encryption_sdk/test_structures.py +++ b/test/unit/test_structures.py @@ -16,7 +16,7 @@ from aws_encryption_sdk.identifiers import Algorithm, ContentType, ObjectType, SerializationVersion from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, MessageHeader, RawDataKey -from ..unit_test_utils import all_invalid_kwargs, all_valid_kwargs +from .unit_test_utils import all_invalid_kwargs, all_valid_kwargs pytestmark = [pytest.mark.unit, pytest.mark.local] From 1a23f5617f6e3a7efc18c7dde77a04706fc98ef1 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 3 Oct 2019 20:40:12 -0700 Subject: [PATCH 12/13] rename test_crypto to vectors to avoid confusion --- test/unit/internal/crypto/authentication/test_signer.py | 2 +- test/unit/internal/crypto/authentication/test_verifier.py | 2 +- test/unit/internal/crypto/test_elliptic_curve.py | 2 +- test/unit/internal/crypto/test_wrapping_keys.py | 2 +- test/unit/internal/crypto/{test_crypto.py => vectors.py} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename test/unit/internal/crypto/{test_crypto.py => vectors.py} (100%) diff --git a/test/unit/internal/crypto/authentication/test_signer.py b/test/unit/internal/crypto/authentication/test_signer.py index f66e8303b..0a55b2e48 100644 --- a/test/unit/internal/crypto/authentication/test_signer.py +++ b/test/unit/internal/crypto/authentication/test_signer.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.crypto.authentication import Signer from aws_encryption_sdk.internal.defaults import ALGORITHM -from ..test_crypto import VALUES +from ..vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/internal/crypto/authentication/test_verifier.py b/test/unit/internal/crypto/authentication/test_verifier.py index fae840567..e25fb78f3 100644 --- a/test/unit/internal/crypto/authentication/test_verifier.py +++ b/test/unit/internal/crypto/authentication/test_verifier.py @@ -19,7 +19,7 @@ from aws_encryption_sdk.internal.crypto.authentication import Verifier from aws_encryption_sdk.internal.defaults import ALGORITHM -from ..test_crypto import VALUES +from ..vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/internal/crypto/test_elliptic_curve.py b/test/unit/internal/crypto/test_elliptic_curve.py index ff5437b98..e0992b2b8 100644 --- a/test/unit/internal/crypto/test_elliptic_curve.py +++ b/test/unit/internal/crypto/test_elliptic_curve.py @@ -29,7 +29,7 @@ _ECCCurveParameters, generate_ecc_signing_key, ) -from .test_crypto import VALUES +from .vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/internal/crypto/test_wrapping_keys.py b/test/unit/internal/crypto/test_wrapping_keys.py index cb7b4489a..2bdcb0983 100644 --- a/test/unit/internal/crypto/test_wrapping_keys.py +++ b/test/unit/internal/crypto/test_wrapping_keys.py @@ -21,7 +21,7 @@ from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey from aws_encryption_sdk.internal.structures import EncryptedData -from .test_crypto import VALUES +from .vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/internal/crypto/test_crypto.py b/test/unit/internal/crypto/vectors.py similarity index 100% rename from test/unit/internal/crypto/test_crypto.py rename to test/unit/internal/crypto/vectors.py From 8cbd0c5e7dbeb7102f703f653c625fac392369fc Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Mon, 7 Oct 2019 15:03:11 -0700 Subject: [PATCH 13/13] autoformat --- test/unit/internal/crypto/test_elliptic_curve.py | 1 + test/unit/internal/utils/test_utils.py | 2 +- test/unit/keyrings/raw/test_raw_rsa.py | 2 +- test/unit/streaming_client/test_encryption_stream.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/unit/internal/crypto/test_elliptic_curve.py b/test/unit/internal/crypto/test_elliptic_curve.py index e0992b2b8..16dcd2686 100644 --- a/test/unit/internal/crypto/test_elliptic_curve.py +++ b/test/unit/internal/crypto/test_elliptic_curve.py @@ -29,6 +29,7 @@ _ECCCurveParameters, generate_ecc_signing_key, ) + from .vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/internal/utils/test_utils.py b/test/unit/internal/utils/test_utils.py index 527d5b0fb..c118ba375 100644 --- a/test/unit/internal/utils/test_utils.py +++ b/test/unit/internal/utils/test_utils.py @@ -24,8 +24,8 @@ from aws_encryption_sdk.keyrings.base import EncryptedDataKey from aws_encryption_sdk.structures import DataKey, MasterKeyInfo, RawDataKey -from ...vectors import VALUES from ...unit_test_utils import assert_prepped_stream_identity +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/keyrings/raw/test_raw_rsa.py b/test/unit/keyrings/raw/test_raw_rsa.py index 748830ab3..460b7280f 100644 --- a/test/unit/keyrings/raw/test_raw_rsa.py +++ b/test/unit/keyrings/raw/test_raw_rsa.py @@ -23,7 +23,6 @@ from aws_encryption_sdk.keyrings.base import Keyring from aws_encryption_sdk.keyrings.raw import RawRSAKeyring -from ...vectors import VALUES from ...unit_test_utils import ( _BACKEND, _DATA_KEY, @@ -38,6 +37,7 @@ get_encryption_materials_with_data_encryption_key, get_encryption_materials_without_data_encryption_key, ) +from ...vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local] diff --git a/test/unit/streaming_client/test_encryption_stream.py b/test/unit/streaming_client/test_encryption_stream.py index 5986d461e..345e9939e 100644 --- a/test/unit/streaming_client/test_encryption_stream.py +++ b/test/unit/streaming_client/test_encryption_stream.py @@ -23,8 +23,8 @@ from aws_encryption_sdk.key_providers.base import MasterKeyProvider from aws_encryption_sdk.streaming_client import _ClientConfig, _EncryptionStream -from ..vectors import VALUES from ..unit_test_utils import assert_prepped_stream_identity +from ..vectors import VALUES pytestmark = [pytest.mark.unit, pytest.mark.local]