diff --git a/certbot-nginx/MANIFEST.in b/certbot-nginx/MANIFEST.in index 39e956ced..65b27877e 100644 --- a/certbot-nginx/MANIFEST.in +++ b/certbot-nginx/MANIFEST.in @@ -1,4 +1,6 @@ include LICENSE.txt include README.rst -recursive-include certbot_nginx/tests/testdata * +recursive-include tests * recursive-include certbot_nginx/_internal/tls_configs *.conf +global-exclude __pycache__ +global-exclude *.py[cod] diff --git a/certbot-nginx/certbot_nginx/tests/__init__.py b/certbot-nginx/certbot_nginx/tests/__init__.py deleted file mode 100644 index 32ca193d9..000000000 --- a/certbot-nginx/certbot_nginx/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Certbot Nginx Tests""" diff --git a/certbot-nginx/certbot_nginx/tests/configurator_test.py b/certbot-nginx/tests/configurator_test.py similarity index 99% rename from certbot-nginx/certbot_nginx/tests/configurator_test.py rename to certbot-nginx/tests/configurator_test.py index a7327166f..9204d464d 100644 --- a/certbot-nginx/certbot_nginx/tests/configurator_test.py +++ b/certbot-nginx/tests/configurator_test.py @@ -16,7 +16,8 @@ from certbot_nginx._internal import obj from certbot_nginx._internal import parser from certbot_nginx._internal.configurator import _redirect_block_for_domain from certbot_nginx._internal.nginxparser import UnspacedList -from certbot_nginx.tests import util + +import test_util as util class NginxConfiguratorTest(util.NginxTest): diff --git a/certbot-nginx/certbot_nginx/tests/display_ops_test.py b/certbot-nginx/tests/display_ops_test.py similarity index 97% rename from certbot-nginx/certbot_nginx/tests/display_ops_test.py rename to certbot-nginx/tests/display_ops_test.py index a03c5d265..e8a3c81d3 100644 --- a/certbot-nginx/certbot_nginx/tests/display_ops_test.py +++ b/certbot-nginx/tests/display_ops_test.py @@ -8,7 +8,8 @@ from certbot.tests import util as certbot_util from certbot_nginx._internal import parser from certbot_nginx._internal.display_ops import select_vhost_multiple -from certbot_nginx.tests import util + +import test_util as util class SelectVhostMultiTest(util.NginxTest): diff --git a/certbot-nginx/certbot_nginx/tests/http_01_test.py b/certbot-nginx/tests/http_01_test.py similarity index 99% rename from certbot-nginx/certbot_nginx/tests/http_01_test.py rename to certbot-nginx/tests/http_01_test.py index 0335aab01..8473d2038 100644 --- a/certbot-nginx/certbot_nginx/tests/http_01_test.py +++ b/certbot-nginx/tests/http_01_test.py @@ -13,7 +13,8 @@ from certbot.tests import acme_util from certbot.tests import util as test_util from certbot_nginx._internal.obj import Addr -from certbot_nginx.tests import util + +import test_util as util AUTH_KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) diff --git a/certbot-nginx/certbot_nginx/tests/nginxparser_test.py b/certbot-nginx/tests/nginxparser_test.py similarity index 99% rename from certbot-nginx/certbot_nginx/tests/nginxparser_test.py rename to certbot-nginx/tests/nginxparser_test.py index 74671a0ec..77fb8a1b2 100644 --- a/certbot-nginx/certbot_nginx/tests/nginxparser_test.py +++ b/certbot-nginx/tests/nginxparser_test.py @@ -8,7 +8,8 @@ from pyparsing import ParseException from certbot_nginx._internal.nginxparser import ( RawNginxParser, loads, load, dumps, dump, UnspacedList) -from certbot_nginx.tests import util + +import test_util as util FIRST = operator.itemgetter(0) diff --git a/certbot-nginx/certbot_nginx/tests/obj_test.py b/certbot-nginx/tests/obj_test.py similarity index 100% rename from certbot-nginx/certbot_nginx/tests/obj_test.py rename to certbot-nginx/tests/obj_test.py diff --git a/certbot-nginx/certbot_nginx/tests/parser_obj_test.py b/certbot-nginx/tests/parser_obj_test.py similarity index 100% rename from certbot-nginx/certbot_nginx/tests/parser_obj_test.py rename to certbot-nginx/tests/parser_obj_test.py diff --git a/certbot-nginx/certbot_nginx/tests/parser_test.py b/certbot-nginx/tests/parser_test.py similarity index 99% rename from certbot-nginx/certbot_nginx/tests/parser_test.py rename to certbot-nginx/tests/parser_test.py index a65247dca..fd5a57582 100644 --- a/certbot-nginx/certbot_nginx/tests/parser_test.py +++ b/certbot-nginx/tests/parser_test.py @@ -12,7 +12,8 @@ from certbot.compat import os from certbot_nginx._internal import nginxparser from certbot_nginx._internal import obj from certbot_nginx._internal import parser -from certbot_nginx.tests import util + +import test_util as util class NginxParserTest(util.NginxTest): diff --git a/certbot-nginx/certbot_nginx/tests/util.py b/certbot-nginx/tests/test_util.py similarity index 98% rename from certbot-nginx/certbot_nginx/tests/util.py rename to certbot-nginx/tests/test_util.py index b238e6232..2ee0bb738 100644 --- a/certbot-nginx/certbot_nginx/tests/util.py +++ b/certbot-nginx/tests/test_util.py @@ -26,7 +26,7 @@ class NginxTest(test_util.ConfigTestCase): self.config = None self.temp_dir, self.config_dir, self.work_dir = common.dir_setup( - "etc_nginx", "certbot_nginx.tests") + "etc_nginx", __name__) self.logs_dir = tempfile.mkdtemp('logs') self.config_path = os.path.join(self.temp_dir, "etc_nginx") @@ -85,7 +85,7 @@ class NginxTest(test_util.ConfigTestCase): def get_data_filename(filename): """Gets the filename of a test data file.""" return pkg_resources.resource_filename( - "certbot_nginx.tests", os.path.join( + __name__, os.path.join( "testdata", "etc_nginx", filename)) diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/broken.conf b/certbot-nginx/tests/testdata/etc_nginx/broken.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/broken.conf rename to certbot-nginx/tests/testdata/etc_nginx/broken.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/comment_in_file.conf b/certbot-nginx/tests/testdata/etc_nginx/comment_in_file.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/comment_in_file.conf rename to certbot-nginx/tests/testdata/etc_nginx/comment_in_file.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/edge_cases.conf b/certbot-nginx/tests/testdata/etc_nginx/edge_cases.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/edge_cases.conf rename to certbot-nginx/tests/testdata/etc_nginx/edge_cases.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/foo.conf b/certbot-nginx/tests/testdata/etc_nginx/foo.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/foo.conf rename to certbot-nginx/tests/testdata/etc_nginx/foo.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/mime.types b/certbot-nginx/tests/testdata/etc_nginx/mime.types similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/mime.types rename to certbot-nginx/tests/testdata/etc_nginx/mime.types diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/minimalistic_comments.conf b/certbot-nginx/tests/testdata/etc_nginx/minimalistic_comments.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/minimalistic_comments.conf rename to certbot-nginx/tests/testdata/etc_nginx/minimalistic_comments.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/multiline_quotes.conf b/certbot-nginx/tests/testdata/etc_nginx/multiline_quotes.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/multiline_quotes.conf rename to certbot-nginx/tests/testdata/etc_nginx/multiline_quotes.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/nginx.conf b/certbot-nginx/tests/testdata/etc_nginx/nginx.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/nginx.conf rename to certbot-nginx/tests/testdata/etc_nginx/nginx.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/server.conf b/certbot-nginx/tests/testdata/etc_nginx/server.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/server.conf rename to certbot-nginx/tests/testdata/etc_nginx/server.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/default b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/default similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/default rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/default diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/example.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/example.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/example.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/example.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/globalssl.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/globalssl.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/globalssl.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/globalssl.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/headers.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/headers.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/headers.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/headers.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/ipv6.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/ipv6.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/ipv6.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/ipv6.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/migration.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/migration.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/migration.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/migration.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/sslon.com b/certbot-nginx/tests/testdata/etc_nginx/sites-enabled/sslon.com similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/sites-enabled/sslon.com rename to certbot-nginx/tests/testdata/etc_nginx/sites-enabled/sslon.com diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params diff --git a/certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf b/certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf similarity index 100% rename from certbot-nginx/certbot_nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf rename to certbot-nginx/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf