From fee3fb6c33a68bed61b7c543af1430e6396e8481 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Wed, 11 Oct 2017 19:05:39 +0300 Subject: [PATCH] Make sure that configurator tests have the expected distro override --- certbot-apache/certbot_apache/tests/configurator_test.py | 6 +++--- certbot-apache/certbot_apache/tests/tls_sni_01_test.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/certbot-apache/certbot_apache/tests/configurator_test.py b/certbot-apache/certbot_apache/tests/configurator_test.py index c96c25ee4..a12671576 100644 --- a/certbot-apache/certbot_apache/tests/configurator_test.py +++ b/certbot-apache/certbot_apache/tests/configurator_test.py @@ -41,6 +41,9 @@ class MultipleVhostsTest(util.ApacheTest): """Mock default vhost path""" if key == "vhost_root": return vhost_path + elif key == "override_class": + from certbot_apache import override_debian + return override_debian.Override else: return orig_os_constant(key) @@ -483,9 +486,6 @@ class MultipleVhostsTest(util.ApacheTest): mock_p = "certbot_apache.configurator.ApacheConfigurator._get_ssl_vhost_path" mock_a = "certbot_apache.parser.ApacheParser.add_include" - from certbot_apache import override_debian - self.config.os_info = override_debian.Override(self.config) - with mock.patch("os.path.isdir") as mock_osp: mock_osp.return_value = False with mock.patch(mock_p) as mock_path: diff --git a/certbot-apache/certbot_apache/tests/tls_sni_01_test.py b/certbot-apache/certbot_apache/tests/tls_sni_01_test.py index 62464d5d0..c9f863386 100644 --- a/certbot-apache/certbot_apache/tests/tls_sni_01_test.py +++ b/certbot-apache/certbot_apache/tests/tls_sni_01_test.py @@ -9,6 +9,7 @@ from certbot.plugins import common_test from certbot_apache import obj from certbot_apache.tests import util +from certbot_apache import override_debian from six.moves import xrange # pylint: disable=redefined-builtin, import-error @@ -25,6 +26,7 @@ class TlsSniPerformTest(util.ApacheTest): config = util.get_apache_configurator( self.config_path, self.vhost_path, self.config_dir, self.work_dir) config.config.tls_sni_01_port = 443 + config.os_info = override_debian.Override(config) from certbot_apache import tls_sni_01 self.sni = tls_sni_01.ApacheTlsSni01(config)