From 32fa3b1d04cac71f90b5ac6d9bf92828b37c1306 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 30 Jun 2017 09:59:19 -0400 Subject: [PATCH] test deploy-hook and renew-hook match --- certbot/tests/cli_test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index 3a943fd1a..cad04f88e 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -329,6 +329,14 @@ class ParseTest(unittest.TestCase): # pylint: disable=too-many-public-methods self.assertRaises(SystemExit, self.parse, "--renew-hook foo --deploy-hook bar".split()) + def test_deploy_hook_matches_renew_hook(self): + value = "foo" + namespace = self.parse(["--renew-hook", value, + "--deploy-hook", value, + "--disable-hook-validation"]) + self.assertEqual(namespace.deploy_hook, value) + self.assertEqual(namespace.renew_hook, value) + def test_deploy_hook_sets_renew_hook(self): value = "foo" namespace = self.parse( @@ -341,6 +349,14 @@ class ParseTest(unittest.TestCase): # pylint: disable=too-many-public-methods self.assertRaises(SystemExit, self.parse, "--deploy-hook foo --renew-hook bar".split()) + def test_renew_hook_matches_deploy_hook(self): + value = "foo" + namespace = self.parse(["--deploy-hook", value, + "--renew-hook", value, + "--disable-hook-validation"]) + self.assertEqual(namespace.deploy_hook, value) + self.assertEqual(namespace.renew_hook, value) + def test_renew_hook_does_not_set_renew_hook(self): value = "foo" namespace = self.parse(