diff --git a/.pylintrc b/.pylintrc index a55f129d2..6689b9a43 100644 --- a/.pylintrc +++ b/.pylintrc @@ -51,7 +51,7 @@ ignore=CVS # CERTBOT COMMENT # Changing this line back to the default of `ignore-paths=` is being tracked by # https://github.com/certbot/certbot/issues/7908. -ignore-paths=.*/_internal/tests/,.*/apache/tests,.*/nginx/tests +ignore-paths=.*/_internal/tests/ # Files or directories matching the regular expression patterns are skipped. # The regex matches against base names, not paths. The default value ignores diff --git a/certbot/MANIFEST.in b/certbot/MANIFEST.in index 3f0a03ef5..b9993906f 100644 --- a/certbot/MANIFEST.in +++ b/certbot/MANIFEST.in @@ -5,10 +5,10 @@ recursive-include docs * recursive-include examples * recursive-include src/certbot/tests/testdata * recursive-include src/certbot/_internal/plugins/nginx/tls_configs *.conf -recursive-include src/certbot/_internal/plugins/nginx/tests/testdata * +recursive-include src/certbot/_internal/tests/plugins/nginx/testdata * recursive-include src/_internal/plugins/apache/augeas_lens *.aug recursive-include src/_internal/plugins/apache/tls_configs *.conf -recursive-include src/_internal/plugins/apache/tests/testdata * +recursive-include src/_internal/tests/plugins/apache/testdata * include src/certbot/ssl-dhparams.pem include src/certbot/py.typed global-exclude __pycache__ diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py index 3bb325269..c4600d995 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py @@ -7,7 +7,7 @@ import pytest from certbot import errors from certbot._internal.plugins.apache import assertions from certbot._internal.plugins.apache import augeasparser -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util def _get_augeasnode_mock(filepath): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py index 278f6d68e..acb84d092 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py @@ -8,7 +8,7 @@ import pytest from certbot import errors from certbot._internal.plugins.apache import constants -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class AutoHSTSTest(util.ApacheTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py index 74eb45172..87fc09fef 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py @@ -9,7 +9,7 @@ from certbot.compat import filesystem from certbot.compat import os from certbot._internal.plugins.apache import obj from certbot._internal.plugins.apache import override_centos -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py index 5f3ae32c7..1e796ed0e 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py @@ -5,7 +5,7 @@ import pytest from certbot import errors from certbot.compat import os -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class ComplexParserTest(util.ParserTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py index f8c914efc..96e980d2f 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py @@ -5,7 +5,7 @@ from unittest import mock import pytest from certbot import errors -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class ConfiguratorReverterTest(util.ApacheTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py index e834f6657..944520eb4 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py @@ -21,7 +21,7 @@ from certbot._internal.plugins.apache import apache_util from certbot._internal.plugins.apache import constants from certbot._internal.plugins.apache import obj from certbot._internal.plugins.apache import parser -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class MultipleVhostsTest(util.ApacheTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py index b37e0722e..06563b9de 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py @@ -10,7 +10,7 @@ from certbot.compat import os from certbot.tests import util as certbot_util from certbot._internal.plugins.apache import apache_util from certbot._internal.plugins.apache import obj -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class MultipleVhostsTestDebian(util.ApacheTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py index 4de51f3cf..925b86968 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py @@ -10,7 +10,7 @@ from certbot.display import util as display_util from certbot.tests import util as certbot_util from certbot._internal.plugins.apache import obj from certbot._internal.plugins.apache.display_ops import select_vhost_multiple -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class SelectVhostMultiTest(unittest.TestCase): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py index 361dfa873..8e515a02d 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py @@ -9,7 +9,7 @@ from certbot.compat import filesystem from certbot.compat import os from certbot._internal.plugins.apache import obj from certbot._internal.plugins.apache import override_fedora -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py index 1a71e1eee..5baa13443 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py @@ -9,7 +9,7 @@ from certbot.compat import filesystem from certbot.compat import os from certbot._internal.plugins.apache import obj from certbot._internal.plugins.apache import override_gentoo -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py index d7d755def..25f835fcc 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py @@ -12,7 +12,7 @@ from certbot.compat import filesystem from certbot.compat import os from certbot.tests import acme_util from certbot._internal.plugins.apache.parser import get_aug_path -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util NUM_ACHALLS = 3 diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py index b97c60ef4..327bc864f 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py @@ -6,7 +6,7 @@ import pytest from certbot import errors from certbot.compat import os -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util class BasicParserTest(util.ParserTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py index 1dcc928a4..162d2b08d 100644 --- a/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py @@ -6,7 +6,7 @@ from unittest import mock import pytest -from certbot._internal.plugins.apache.tests import util +from certbot._internal.tests.plugins.apache import util if importlib.util.find_spec('apacheconfig'): diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py index 948f1d464..290ebcb94 100644 --- a/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py @@ -15,7 +15,7 @@ from certbot._internal.plugins.nginx import obj from certbot._internal.plugins.nginx import parser from certbot._internal.plugins.nginx.configurator import _redirect_block_for_domain from certbot._internal.plugins.nginx.nginxparser import UnspacedList -from certbot._internal.plugins.nginx.tests import test_util as util +from certbot._internal.tests.plugins.nginx import test_util as util class NginxConfiguratorTest(util.NginxTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py index a185f991e..96f21495d 100644 --- a/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py @@ -7,7 +7,7 @@ from certbot.display import util as display_util from certbot.tests import util as certbot_util from certbot._internal.plugins.nginx import parser from certbot._internal.plugins.nginx.display_ops import select_vhost_multiple -from certbot._internal.plugins.nginx.tests import test_util as util +from certbot._internal.tests.plugins.nginx import test_util as util class SelectVhostMultiTest(util.NginxTest): diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py index 5b222d23b..6c62033f1 100644 --- a/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py @@ -10,7 +10,7 @@ from certbot import achallenges from certbot.tests import acme_util from certbot.tests import util as test_util from certbot._internal.plugins.nginx.obj import Addr -from certbot._internal.plugins.nginx.tests import test_util as util +from certbot._internal.tests.plugins.nginx import test_util as util AUTH_KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py index a23c3de24..58c7f4faa 100644 --- a/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py @@ -14,7 +14,7 @@ from certbot._internal.plugins.nginx.nginxparser import load from certbot._internal.plugins.nginx.nginxparser import loads from certbot._internal.plugins.nginx.nginxparser import RawNginxParser from certbot._internal.plugins.nginx.nginxparser import UnspacedList -from certbot._internal.plugins.nginx.tests import test_util as util +from certbot._internal.tests.plugins.nginx import test_util as util FIRST = operator.itemgetter(0) diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py index 54a41d687..912bd48fe 100644 --- a/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py @@ -11,7 +11,7 @@ from certbot.compat import os from certbot._internal.plugins.nginx import nginxparser from certbot._internal.plugins.nginx import obj from certbot._internal.plugins.nginx import parser -from certbot._internal.plugins.nginx.tests import test_util as util +from certbot._internal.tests.plugins.nginx import test_util as util class NginxParserTest(util.NginxTest): diff --git a/tox.ini b/tox.ini index 8c66e65a8..1a4f4eb51 100644 --- a/tox.ini +++ b/tox.ini @@ -120,8 +120,6 @@ description = Tests Certbot without any additional plugins installed deps = {[testenv:isolated-acme]deps} -e certbot[test] -# we ignore apache/nginx since those tests depend on their respective extra dependencies (which are pulled in by their plugin) -commands = {[base]pytest} certbot --ignore certbot/src/certbot/_internal/plugins/apache --ignore certbot/src/certbot/_internal/plugins/nginx [testenv:isolated-{apache,cloudflare,digitalocean,dnsimple,dnsmadeeasy,gehirn,google,linode,luadns,nsone,ovh,rfc2136,route53,sakuracloud,nginx}] description = Tests the plugin without installing any other plugins @@ -165,27 +163,27 @@ deps = -e certbot -e certbot-apache commands = - {toxinidir}/certbot/src/certbot/_internal/plugins/apache/tests/apache-conf-files/apache-conf-test --debian-modules + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test --debian-modules passenv = SERVER allowlist_externals = - {toxinidir}/certbot/src/certbot/_internal/plugins/apache/tests/apache-conf-files/apache-conf-test + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test [testenv:apacheconftest-external-with-pebble] description = Run apacheconftest with pebble and Certbot outside of the tox virtual environment. deps = -e certbot-ci allowlist_externals = - {toxinidir}/certbot/src/certbot/_internal/plugins/apache/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py commands = - {toxinidir}/certbot/src/certbot/_internal/plugins/apache/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py --debian-modules [testenv:apacheconftest-with-pebble] deps = {[testenv:apacheconftest]deps} {[testenv:apacheconftest-external-with-pebble]deps} allowlist_externals = - {toxinidir}/certbot/src/certbot/_internal/plugins/apache/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py commands = {[testenv:apacheconftest-external-with-pebble]commands} [testenv:nginxroundtrip]