mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 14:22:56 +00:00
Add isort and flake8 to CI (#869)
* Run isort. * Clean up unused assignments. * Add flake8 linting step.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
@@ -15,12 +17,11 @@ from ansible_collections.community.crypto.plugins.module_utils.acme.backends imp
|
||||
CertificateInformation,
|
||||
CryptoBackend,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
||||
BackendException,
|
||||
)
|
||||
|
||||
from ..test_time import cartesian_product, TIMEZONES
|
||||
from ..test_time import TIMEZONES, cartesian_product
|
||||
|
||||
|
||||
def load_fixture(name):
|
||||
|
||||
@@ -3,41 +3,40 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.backend_cryptography import (
|
||||
HAS_CURRENT_CRYPTOGRAPHY,
|
||||
CryptographyBackend,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.crypto.cryptography_support import (
|
||||
CRYPTOGRAPHY_TIMEZONE,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.time import (
|
||||
ensure_utc_timezone,
|
||||
UTC,
|
||||
ensure_utc_timezone,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
from freezegun import freeze_time
|
||||
|
||||
from ..test_time import TIMEZONES
|
||||
from .backend_data import (
|
||||
TEST_KEYS,
|
||||
TEST_CSRS,
|
||||
TEST_CERT,
|
||||
TEST_CERT_DAYS,
|
||||
TEST_CERT_INFO,
|
||||
TEST_PARSE_ACME_TIMESTAMP,
|
||||
TEST_CSRS,
|
||||
TEST_INTERPOLATE_TIMESTAMP,
|
||||
TEST_KEYS,
|
||||
TEST_PARSE_ACME_TIMESTAMP,
|
||||
)
|
||||
|
||||
from ..test_time import TIMEZONES
|
||||
|
||||
|
||||
if not HAS_CURRENT_CRYPTOGRAPHY:
|
||||
pytest.skip('cryptography not found')
|
||||
|
||||
@@ -3,36 +3,37 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.backend_openssl_cli import (
|
||||
OpenSSLCLIBackend,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.time import (
|
||||
ensure_utc_timezone,
|
||||
UTC,
|
||||
ensure_utc_timezone,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
from freezegun import freeze_time
|
||||
|
||||
from .backend_data import (
|
||||
TEST_KEYS,
|
||||
TEST_CSRS,
|
||||
TEST_CERT,
|
||||
TEST_CERT_OPENSSL_OUTPUT,
|
||||
TEST_CERT_DAYS,
|
||||
TEST_CERT_INFO,
|
||||
TEST_PARSE_ACME_TIMESTAMP,
|
||||
TEST_CERT_OPENSSL_OUTPUT,
|
||||
TEST_CSRS,
|
||||
TEST_INTERPOLATE_TIMESTAMP,
|
||||
TEST_KEYS,
|
||||
TEST_PARSE_ACME_TIMESTAMP,
|
||||
)
|
||||
|
||||
|
||||
# from ..test_time import TIMEZONES
|
||||
|
||||
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.challenges import (
|
||||
Authorization,
|
||||
Challenge,
|
||||
combine_identifier,
|
||||
split_identifier,
|
||||
Challenge,
|
||||
Authorization,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
||||
ACMEProtocolException,
|
||||
ModuleFailException,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
|
||||
|
||||
def test_combine_identifier():
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
||||
format_error_problem,
|
||||
ACMEProtocolException,
|
||||
format_error_problem,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -3,16 +3,18 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.io import (
|
||||
read_file,
|
||||
write_file,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
|
||||
|
||||
TEST_TEXT = r"""1234
|
||||
|
||||
@@ -3,21 +3,19 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.orders import (
|
||||
Order,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
||||
ACMEProtocolException,
|
||||
)
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.orders import Order
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
|
||||
|
||||
def test_order_from_json():
|
||||
|
||||
@@ -3,28 +3,26 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.backends import (
|
||||
CertificateInformation,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.acme.utils import (
|
||||
compute_cert_id,
|
||||
nopad_b64,
|
||||
parse_retry_after,
|
||||
pem_to_der,
|
||||
process_links,
|
||||
parse_retry_after,
|
||||
compute_cert_id,
|
||||
)
|
||||
|
||||
from .backend_data import (
|
||||
TEST_PEM_DERS,
|
||||
)
|
||||
from .backend_data import TEST_PEM_DERS
|
||||
|
||||
|
||||
NOPAD_B64 = [
|
||||
|
||||
Reference in New Issue
Block a user