mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 00:02:14 -04:00
parent
df5f08843f
commit
83966cdfcf
2 changed files with 16 additions and 0 deletions
|
|
@ -335,6 +335,7 @@ class HelpfulArgumentParser(object):
|
|||
self.help_topics = HELP_TOPICS + plugin_names + [None]
|
||||
usage, short_usage = usage_strings(plugins)
|
||||
self.parser = configargparse.ArgParser(
|
||||
prog="certbot",
|
||||
usage=short_usage,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
args_for_setting_config_path=["-c", "--config"],
|
||||
|
|
|
|||
|
|
@ -143,6 +143,21 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
|||
out = self._help_output(['-h'])
|
||||
self.assertTrue(cli.usage_strings(plugins)[0] in out)
|
||||
|
||||
def test_version_string_program_name(self):
|
||||
toy_out = six.StringIO()
|
||||
toy_err = six.StringIO()
|
||||
with mock.patch('certbot.main.sys.stdout', new=toy_out):
|
||||
with mock.patch('certbot.main.sys.stderr', new=toy_err):
|
||||
try:
|
||||
main.main(["--version"])
|
||||
except SystemExit:
|
||||
pass
|
||||
finally:
|
||||
output = toy_out.getvalue() or toy_err.getvalue()
|
||||
self.assertTrue("certbot" in output, "Output is {0}".format(output))
|
||||
toy_out.close()
|
||||
toy_err.close()
|
||||
|
||||
def _cli_missing_flag(self, args, message):
|
||||
"Ensure that a particular error raises a missing cli flag error containing message"
|
||||
exc = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue