Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def test_choices_nodesc_doc(self):
     the_opt = CmdOption(opt_choices_nodesc)
     doc = the_opt.help_doc()[0]
     assert "choices: no, yes" in doc
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 def test_no_doc_param(self):
     opt1 = CmdOption(opt_no)
     assert 0 == len(opt1.help_doc())
Exemplo n.º 6
0
 def test_choices_nodesc_doc(self):
     the_opt = CmdOption(opt_choices_nodesc)
     doc = the_opt.help_doc()[0]
     assert "choices: no, yes" in doc
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 def test_no_doc_param(self):
     opt1 = CmdOption(opt_no)
     assert 0 == len(opt1.help_doc())
Exemplo n.º 9
0
 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]
Exemplo n.º 10
0
 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]