test --renew-hook

This commit is contained in:
Brad Warren
2017-06-30 09:56:17 -04:00
parent feffeb275b
commit ad4ed22932
+13 -1
View File
@@ -40,7 +40,7 @@ class TestReadFile(TempDirTestCase):
class ParseTest(unittest.TestCase): class ParseTest(unittest.TestCase): # pylint: disable=too-many-public-methods
'''Test the cli args entrypoint''' '''Test the cli args entrypoint'''
_multiprocess_can_split_ = True _multiprocess_can_split_ = True
@@ -336,6 +336,18 @@ class ParseTest(unittest.TestCase):
self.assertEqual(namespace.deploy_hook, value) self.assertEqual(namespace.deploy_hook, value)
self.assertEqual(namespace.renew_hook, value) self.assertEqual(namespace.renew_hook, value)
def test_renew_hook_conflict(self):
with mock.patch("certbot.cli.sys.stderr"):
self.assertRaises(SystemExit, self.parse,
"--deploy-hook foo --renew-hook bar".split())
def test_renew_hook_does_not_set_renew_hook(self):
value = "foo"
namespace = self.parse(
["--renew-hook", value, "--disable-hook-validation"])
self.assertEqual(namespace.deploy_hook, None)
self.assertEqual(namespace.renew_hook, value)
class DefaultTest(unittest.TestCase): class DefaultTest(unittest.TestCase):
"""Tests for certbot.cli._Default.""" """Tests for certbot.cli._Default."""