示例#1
0
文件: main.py 项目: IlsooByun/ceph
 def help(self, warning=False):
     warning = 'See "ceph-volume --help" for full list of options.' if warning else ''
     return self._help.format(
         warning=warning,
         log_path=conf.log_path,
         ceph_path=self.stat_ceph_conf(),
         plugins=self.plugin_help,
         sub_help=terminal.subhelp(self.mapper),
         environ_vars=self.get_environ_vars()
     )
示例#2
0
 def main(self):
     terminal.dispatch(self.mapper, self.argv)
     parser = argparse.ArgumentParser(
         prog='ceph-volume lvm',
         formatter_class=argparse.RawDescriptionHelpFormatter,
         description=self.print_help(terminal.subhelp(self.mapper)),
     )
     parser.parse_args(self.argv)
     if len(self.argv) <= 1:
         return parser.print_help()
示例#3
0
 def test_has_title_header(self):
     result = terminal.subhelp({'sub': SubCommand})
     assert 'Available subcommands:' in result
示例#4
0
    def test_single_level_help(self):
        result = terminal.subhelp({'sub': SubCommand})

        assert 'this is the subcommand help' in result
示例#5
0
 def test_no_sub_command_help(self):
     assert terminal.subhelp({}) == ''
示例#6
0
 def test_command_with_no_help(self):
     class SubCommandNoHelp(object):
         pass
     result = terminal.subhelp({'sub': SubCommandNoHelp})
     assert result == ''
示例#7
0
 def test_has_title_header(self):
     result = terminal.subhelp({'sub': SubCommand})
     assert 'Available subcommands:' in result
示例#8
0
    def test_single_level_help(self):
        result = terminal.subhelp({'sub': SubCommand})

        assert 'this is the subcommand help' in result
示例#9
0
 def test_no_sub_command_help(self):
     assert terminal.subhelp({}) == ''
示例#10
0
    def test_command_with_no_help(self):
        class SubCommandNoHelp(object):
            pass

        result = terminal.subhelp({'sub': SubCommandNoHelp})
        assert result == ''