| 685 | manual_command_sets_app.unregister_command_set(base_cmds) |
| 686 | |
| 687 | class BadNestedSubcommands(cmd2.CommandSet): |
| 688 | def __init__(self, dummy) -> None: |
| 689 | super().__init__() |
| 690 | self._dummy = dummy # prevents autoload |
| 691 | |
| 692 | stir_pasta_vigor_parser = cmd2.Cmd2ArgumentParser() |
| 693 | stir_pasta_vigor_parser.add_argument("frequency") |
| 694 | |
| 695 | # stir sauce doesn't exist anywhere, this should fail |
| 696 | @cmd2.as_subcommand_to("stir sauce", "vigorously", stir_pasta_vigor_parser) |
| 697 | def stir_pasta_vigorously(self, ns: argparse.Namespace) -> None: |
| 698 | self._cmd.poutput("stir the pasta vigorously") |
| 699 | |
| 700 | with pytest.raises(CommandSetRegistrationError): |
| 701 | manual_command_sets_app.register_command_set(BadNestedSubcommands(1)) |
no outgoing calls
searching dependent graphs…