Esempio n. 1
0
 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()
     )
Esempio n. 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()
Esempio n. 3
0
 def test_has_title_header(self):
     result = terminal.subhelp({'sub': SubCommand})
     assert 'Available subcommands:' in result
Esempio n. 4
0
    def test_single_level_help(self):
        result = terminal.subhelp({'sub': SubCommand})

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

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

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