Example #1
0
    def cli_test(self, cmd_tree, command):
        """ A small helper function to test CLI parsing
        """
        cmd = Command(cmd_tree, command)
        comp = cmd.complete()

        return cmd.exe, cmd.arg, cmd.exe_options, set(comp)
Example #2
0
    def cli_test(self, cmd_tree, command):
        """ A small helper function to test CLI parsing
        """
        cmd = Command(cmd_tree, command)
        comp = cmd.complete()

        return cmd.exe, cmd.arg, cmd.exe_options, set(comp)
Example #3
0
    def test_test1(self):
        from nipap_cli.command import Command, InvalidCommand
        from nipap_cli import nipap_cli
        from pynipap import NipapError

        cmd = Command(nipap_cli.cmds, ['vrf', 'list', 'nam'])
        self.assertEqual(['name'], sorted(cmd.complete()))

        cmd = Command(nipap_cli.cmds, ['vrf', 'list', 'name'])
        self.assertEqual(['name'], sorted(cmd.complete()))