mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
Add tests for the --preferred-challenges cli parser
This commit is contained in:
@@ -423,6 +423,18 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
namespace = parse(long_args)
|
||||
self.assertEqual(namespace.domains, ['example.com', 'another.net'])
|
||||
|
||||
def test_preferred_challenges(self):
|
||||
from acme.challenges import HTTP01, TLSSNI01, DNS01
|
||||
parse = self._get_argument_parser()
|
||||
|
||||
short_args = ['--preferred-challenges', 'http, tls-sni-01, dns']
|
||||
namespace = parse(short_args)
|
||||
|
||||
self.assertEqual(namespace.pref_challs, [HTTP01, TLSSNI01, DNS01])
|
||||
|
||||
short_args = ['--preferred-challenges', 'jumping-over-the-moon']
|
||||
self.assertRaises(argparse.ArgumentTypeError, parse, short_args)
|
||||
|
||||
def test_server_flag(self):
|
||||
parse = self._get_argument_parser()
|
||||
namespace = parse('--server example.com'.split())
|
||||
|
||||
Reference in New Issue
Block a user