mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
test --renew-hook
This commit is contained in:
@@ -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."""
|
||||||
|
|||||||
Reference in New Issue
Block a user