Remove one more implementation assumption from our tests

This commit is contained in:
Erica Portnoy 2020-02-14 13:03:15 -08:00
parent 36fbd2e449
commit 8858c67ef3

View file

@ -42,8 +42,11 @@ class AutoHSTSTest(util.ApacheTest):
@mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart")
@mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.enable_mod")
def test_autohsts_enable_headers_mod(self, mock_enable, _restart):
self.config.parser.modules.discard("headers_module")
self.config.parser.modules.discard("mod_header.c")
try:
del self.config.parser.modules["headers_module"]
del self.config.parser.modules["mod_header.c"]
except KeyError:
pass
self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com"])
self.assertTrue(mock_enable.called)