mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:30:31 +02:00
Test for CLI --webroot-map parsing
This commit is contained in:
@@ -341,11 +341,12 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
namespace = cli.prepare_and_parse_args(plugins, long_args)
|
||||
self.assertEqual(namespace.domains, ['example.com', 'another.net'])
|
||||
|
||||
def test_parse_webroot(self):
|
||||
plugins = disco.PluginsRegistry.find_all()
|
||||
webroot_args = ['--webroot', '-d', 'stray.example.com', '-w',
|
||||
'/var/www/example', '-d', 'example.com,www.example.com', '-w',
|
||||
'/var/www/superfluous', '-d', 'superfluo.us', '-d', 'www.superfluo.us']
|
||||
namespace = cli.prepare_and_parse_args(plugins, webroot_args)
|
||||
open("/tmp/frogs", "w").write("%r" % namespace)
|
||||
self.assertEqual(namespace.webroot_map, {
|
||||
'example.com' : '/var/www/example',
|
||||
'stray.example.com' : '/var/www/example',
|
||||
@@ -353,6 +354,10 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
'www.superfluo.us' : '/var/www/superfluous',
|
||||
'superfluo.us' : '/var/www/superfluous'})
|
||||
|
||||
webroot_map_args = ['--webroot-map', '{"eg.com" : "/tmp"}']
|
||||
namespace = cli.prepare_and_parse_args(plugins, webroot_map_args)
|
||||
self.assertEqual(namespace.webroot_map, {u"eg.com" : u"/tmp"})
|
||||
|
||||
@mock.patch('letsencrypt.crypto_util.notAfter')
|
||||
@mock.patch('letsencrypt.cli.zope.component.getUtility')
|
||||
def test_certonly_new_request_success(self, mock_get_utility, mock_notAfter):
|
||||
|
||||
Reference in New Issue
Block a user