diff options
author | Joona Hoikkala <joona@kuori.org> | 2015-12-11 01:03:00 +0300 |
---|---|---|
committer | Joona Hoikkala <joona@kuori.org> | 2015-12-11 01:03:00 +0300 |
commit | 7bf8842ba7107a86318c7a954e7ed00b3fc904f5 (patch) | |
tree | 831d164346214e8340daa2ae57d3e8bb7ddf8ff2 /letsencrypt-apache | |
parent | 509c192ab8e3515e3733a91769e2ec42b2b7acc0 (diff) |
Added missing test for full coverage
Diffstat (limited to 'letsencrypt-apache')
-rw-r--r-- | letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py index b93034cd9..e16dff173 100644 --- a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py +++ b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py @@ -116,6 +116,24 @@ class TwoVhost80Test(util.ApacheTest): self.assertEqual(found, 6) + # Handle case of non-debian layout get_virtual_hosts + orig_conf = self.config.conf + with mock.patch( + "letsencrypt_apache.configurator.ApacheConfigurator.conf" + ) as mock_conf: + def conf_sideeffect(key): + """Handle calls to configurator.conf() + :param key: configuration key + :return: configuration value + """ + if key == "handle-sites": + return False + else: + return orig_conf(key) + mock_conf.side_effect = conf_sideeffect + vhs = self.config.get_virtual_hosts() + self.assertEqual(len(vhs), 6) + @mock.patch("letsencrypt_apache.display_ops.select_vhost") def test_choose_vhost_none_avail(self, mock_select): mock_select.return_value = None |