def test_param(self): opt1 = CmdOption(opt_bool) got = opt1.help_doc() assert '-f, --flag' in got[0] assert 'help for opt1' in got[0] assert '--no-flag' in got[1] assert 2 == len(got)
def test_choices_nodesc_doc(self): the_opt = CmdOption(opt_choices_nodesc) doc = the_opt.help_doc()[0] assert "choices: no, yes" in doc
def test_choices_desc_doc(self): the_opt = CmdOption(opt_choices_desc) doc = the_opt.help_doc()[0] assert 'choices:\n' in doc assert 'yes: signify affirmative' in doc assert 'no: signify negative' in doc
def test_no_doc_param(self): opt1 = CmdOption(opt_no) assert 0 == len(opt1.help_doc())
def test_name_config_env(self): opt1 = CmdOption(opt_rare) got = opt1.help_doc() assert 'config: rare_bool' in got[0] assert 'environ: RARE' in got[0]