Class for testing custom help_* methods which override docstring help.
| 1305 | |
| 1306 | |
| 1307 | class HelpApp(cmd2.Cmd): |
| 1308 | """Class for testing custom help_* methods which override docstring help.""" |
| 1309 | |
| 1310 | DEFAULT_CATEGORY = "My Default Category." |
| 1311 | MISC_HEADER = "Various topics found here." |
| 1312 | |
| 1313 | def __init__(self, *args, **kwargs) -> None: |
| 1314 | super().__init__(*args, **kwargs) |
| 1315 | self.doc_leader = "I now present you with a list of help topics." |
| 1316 | |
| 1317 | def do_squat(self, arg) -> None: |
| 1318 | """This docstring help will never be shown because the help_squat method overrides it.""" |
| 1319 | |
| 1320 | def help_squat(self) -> None: |
| 1321 | self.stdout.write("This command does diddly squat...\n") |
| 1322 | |
| 1323 | def do_edit(self, arg) -> None: |
| 1324 | """This overrides the edit command and does nothing.""" |
| 1325 | |
| 1326 | # This command has no help text |
| 1327 | def do_no_help(self, arg) -> None: |
| 1328 | pass |
| 1329 | |
| 1330 | def do_multiline_docstr(self, arg) -> None: |
| 1331 | """This documentation |
| 1332 | is multiple lines |
| 1333 | and there are no |
| 1334 | tabs |
| 1335 | """ |
| 1336 | |
| 1337 | def help_physics(self): |
| 1338 | """A miscellaneous help topic.""" |
| 1339 | self.poutput("Here is some help on physics.") |
| 1340 | |
| 1341 | parser_cmd_parser = cmd2.Cmd2ArgumentParser(description="This is the description.") |
| 1342 | |
| 1343 | @cmd2.with_argparser(parser_cmd_parser) |
| 1344 | def do_parser_cmd(self, args) -> None: |
| 1345 | """This is the docstring.""" |
| 1346 | |
| 1347 | |
| 1348 | @pytest.fixture |
no outgoing calls
searching dependent graphs…