mirror of
https://github.com/certbot/certbot.git
synced 2026-06-07 15:52:08 -04:00
add coverage and lint
This commit is contained in:
parent
01177bf315
commit
ff26c3e623
2 changed files with 5 additions and 1 deletions
|
|
@ -242,7 +242,7 @@ class ApacheConfigurator(common.Installer):
|
|||
try:
|
||||
with open(ssl_module_location, mode="rb") as f:
|
||||
contents = f.read()
|
||||
except IOError as error:
|
||||
except IOError:
|
||||
return None
|
||||
return contents
|
||||
|
||||
|
|
|
|||
|
|
@ -1836,6 +1836,10 @@ class InstallSslOptionsConfTest(util.ApacheTest):
|
|||
self.assertEqual(self.config.openssl_version(), None)
|
||||
self.assertTrue("Could not find OpenSSL" in mock_log.call_args[0][0])
|
||||
|
||||
def test_open_module_file(self):
|
||||
mock_open = mock.mock_open(read_data="testing 12 3")
|
||||
with mock.patch("certbot_apache._internal.configurator.open", mock_open):
|
||||
self.assertEqual (self.config._open_module_file("/nonsense/"), "testing 12 3")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
Loading…
Reference in a new issue