mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Update and run isort (#9573)
I want to use isort as part of https://github.com/certbot/certbot/issues/9572 because I want to do it programmatically, however, I felt like the config needed to be tweaked a bit due to it not understanding what is and is not our own code. This PR updates the isort config so it recognizes our own modules and runs `isort .` from the root of the repo to update everything. * update isort config * run "isort ."
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
"""Tests for AugeasParserNode classes"""
|
||||
from typing import List
|
||||
|
||||
import os
|
||||
import util
|
||||
from typing import List
|
||||
from unittest import mock
|
||||
|
||||
from certbot import errors
|
||||
|
||||
from certbot_apache._internal import assertions
|
||||
from certbot_apache._internal import augeasparser
|
||||
import util
|
||||
|
||||
|
||||
def _get_augeasnode_mock(filepath):
|
||||
|
||||
@@ -5,8 +5,8 @@ from unittest import mock
|
||||
from certbot import errors
|
||||
from certbot.compat import filesystem
|
||||
from certbot.compat import os
|
||||
from certbot_apache._internal import override_centos
|
||||
from certbot_apache._internal import obj
|
||||
from certbot_apache._internal import override_centos
|
||||
import util
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ class MultipleVhostsTest(util.ApacheTest):
|
||||
|
||||
def test_add_parser_arguments(self): # pylint: disable=no-self-use
|
||||
from certbot_apache._internal.configurator import ApacheConfigurator
|
||||
|
||||
# Weak test..
|
||||
ApacheConfigurator.add_parser_arguments(mock.MagicMock())
|
||||
|
||||
@@ -123,8 +124,8 @@ class MultipleVhostsTest(util.ApacheTest):
|
||||
cls.add_parser_arguments(mock.MagicMock())
|
||||
|
||||
def test_all_configurators_defaults_defined(self):
|
||||
from certbot_apache._internal.entrypoint import OVERRIDE_CLASSES
|
||||
from certbot_apache._internal.configurator import ApacheConfigurator
|
||||
from certbot_apache._internal.entrypoint import OVERRIDE_CLASSES
|
||||
parameters = set(ApacheConfigurator.OS_DEFAULTS.__dict__.keys())
|
||||
for cls in OVERRIDE_CLASSES.values():
|
||||
self.assertIs(parameters.issubset(set(cls.OS_DEFAULTS.__dict__.keys())), True)
|
||||
@@ -1669,9 +1670,10 @@ class InstallSslOptionsConfTest(util.ApacheTest):
|
||||
file has been manually edited by the user, and will refuse to update it.
|
||||
This test ensures that all necessary hashes are present.
|
||||
"""
|
||||
from certbot_apache._internal.constants import ALL_SSL_OPTIONS_HASHES
|
||||
import pkg_resources
|
||||
|
||||
from certbot_apache._internal.constants import ALL_SSL_OPTIONS_HASHES
|
||||
|
||||
tls_configs_dir = pkg_resources.resource_filename(
|
||||
"certbot_apache", os.path.join("_internal", "tls_configs"))
|
||||
all_files = [os.path.join(tls_configs_dir, name) for name in os.listdir(tls_configs_dir)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Test for certbot_apache._internal.http_01."""
|
||||
import unittest
|
||||
import errno
|
||||
from typing import List
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from acme import challenges
|
||||
|
||||
@@ -128,6 +128,7 @@ class BasicParserTest(util.ParserTest):
|
||||
|
||||
"""
|
||||
from certbot_apache._internal.parser import get_aug_path
|
||||
|
||||
# This makes sure that find_dir will work
|
||||
self.parser.modules["mod_ssl.c"] = "/fake/path"
|
||||
|
||||
@@ -142,6 +143,7 @@ class BasicParserTest(util.ParserTest):
|
||||
|
||||
def test_add_dir_to_ifmodssl_multiple(self):
|
||||
from certbot_apache._internal.parser import get_aug_path
|
||||
|
||||
# This makes sure that find_dir will work
|
||||
self.parser.modules["mod_ssl.c"] = "/fake/path"
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""Common utilities for certbot_apache."""
|
||||
import shutil
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import augeas
|
||||
import josepy as jose
|
||||
from unittest import mock
|
||||
|
||||
from certbot.compat import os
|
||||
from certbot.plugins import common
|
||||
|
||||
Reference in New Issue
Block a user