예제 #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
파일: main.py 프로젝트: Abhishekvrshny/ceph
 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
파일: test_terminal.py 프로젝트: yyhhj/ceph
 def test_has_title_header(self):
     result = terminal.subhelp({'sub': SubCommand})
     assert 'Available subcommands:' in result
예제 #4
0
파일: test_terminal.py 프로젝트: yyhhj/ceph
    def test_single_level_help(self):
        result = terminal.subhelp({'sub': SubCommand})

        assert 'this is the subcommand help' in result
예제 #5
0
파일: test_terminal.py 프로젝트: yyhhj/ceph
 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 == ''