コード例 #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)
コード例 #2
0
ファイル: cli-test.py プロジェクト: SpriteLink/NIPAP
    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)
コード例 #3
0
ファイル: nipaptest.py プロジェクト: sohonet/NIPAP
    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()))