From 4e62a4bfe2465817c1b47a59c2cef00d98eac333 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 30 Oct 2015 13:54:46 -0700 Subject: [PATCH] fixes #1227 --- letsencrypt/cli.py | 4 +++- letsencrypt/tests/cli_test.py | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 641d0d341..fdfa5bbfb 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -85,6 +85,7 @@ More detailed help: plugins (certonly, install, nginx, apache, standalone, etc) """ + def usage_strings(plugins): """Make usage strings late so that plugins can be initialised late""" if "nginx" in plugins: @@ -494,7 +495,8 @@ def install(args, config, plugins): # XXX: Update for renewer/RenewableCert try: - installer, _ = choose_configurator_plugins(args, config, plugins, "certonly") + installer, _ = choose_configurator_plugins(args, config, + plugins, "install") except PluginSelectionError, e: return e.message diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index 669fa1ce8..55946e7aa 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -106,6 +106,12 @@ class CLITest(unittest.TestCase): from letsencrypt import cli self.assertTrue(cli.usage_strings(plugins)[0] in out) + @mock.patch('letsencrypt.cli.display_ops') + def test_installer_selection(self, mock_display_ops): + self._call(['install', '--domain', 'foo.bar', '--cert-path', 'cert', + '--key-path', 'key', '--chain-path', 'chain']) + self.assertEqual(mock_display_ops.pick_installer.call_count, 1) + def test_configurator_selection(self): real_plugins = disco.PluginsRegistry.find_all() args = ['--agree-dev-preview', '--apache', @@ -221,7 +227,7 @@ class CLITest(unittest.TestCase): @mock.patch('letsencrypt.cli.zope.component.getUtility') @mock.patch('letsencrypt.cli._init_le_client') def test_certonly_csr(self, mock_init, mock_get_utility, - mock_pick_installer, mock_notAfter): + mock_pick_installer, mock_notAfter): cert_path = '/etc/letsencrypt/live/blahcert.pem' date = '1970-01-01' mock_notAfter().date.return_value = date