diff options
author | osirisinferi <github@flut.demon.nl> | 2020-02-22 17:22:27 +0300 |
---|---|---|
committer | osirisinferi <github@flut.demon.nl> | 2020-02-22 17:22:27 +0300 |
commit | 9819443440382695b74b77379d76e4886c0bdf70 (patch) | |
tree | db2eb62af73b422d5bcabb8fc7b8eda1db6e0eb2 | |
parent | d3a4b8fd8c068624b40179f567e191b6979bf6cf (diff) |
Add test
-rw-r--r-- | certbot-apache/tests/http_01_test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/certbot-apache/tests/http_01_test.py b/certbot-apache/tests/http_01_test.py index 643a6bdd5..422a76443 100644 --- a/certbot-apache/tests/http_01_test.py +++ b/certbot-apache/tests/http_01_test.py @@ -1,5 +1,6 @@ """Test for certbot_apache._internal.http_01.""" import unittest +import errno import mock @@ -197,6 +198,12 @@ class ApacheHttp01Test(util.ApacheTest): self.assertTrue(os.path.exists(challenge_dir)) + @mock.patch("certbot_apache._internal.http_01.filesystem.makedirs") + def test_failed_makedirs(self, mock_makedirs): + mock_makedirs.side_effect = OSError(errno.EACCES, "msg") + self.http.add_chall(self.achalls[0]) + self.assertRaises(errors.PluginError, self.http.perform) + def _test_challenge_conf(self): with open(self.http.challenge_conf_pre) as f: pre_conf_contents = f.read() |