Exemplo n.º 1
0
    def setUp(self):
        ShellBaseTest.setUp(self)

        class TestSubOptions(Options):
            desc = """
                short sub-command description string

                Long sub-command description string.
                """
            usage = '[options]'
            opts = [
                Opt('alpha', 'a', 'alpha help string', store=int),
                Opt('echo', 'e', 'echo help string', store=True),
                Opt('foxtrot', '', 'foxtrot help string', store=str) ]

        class TestOptions(Options):
            desc = """
                short command description string

                Long command description string.
                """
            usage = '[options]'
            cmds = {
                'subcmd|sub-command':TestSubOptions }
            opts = [
                Opt('alpha', 'a', 'alpha help string', store=True),
                Opt('bravo', 'b', 'bravo help string', store=int, metavar='INT'),
                Opt('charlie', '', 'charlie help string', store=True),
                Opt('delta', '', 'delta help string', store=str) ]

        self.ui = self.shell
        self.cmd = TestOptions(name='cmd', ui=self.ui)
Exemplo n.º 2
0
    def setUp(self):
        ShellBaseTest.setUp(self)

        class TestSubOptions(Options):
            desc = """
                short sub-command description string

                Long sub-command description string.
                """
            usage = '[options]'
            opts = [
                Opt('alpha', 'a', 'alpha help string', store=int),
                Opt('echo', 'e', 'echo help string', store=True),
                Opt('foxtrot', '', 'foxtrot help string', store=str)
            ]

        class TestOptions(Options):
            desc = """
                short command description string

                Long command description string.
                """
            usage = '[options]'
            cmds = {'subcmd|sub-command': TestSubOptions}
            opts = [
                Opt('alpha', 'a', 'alpha help string', store=True),
                Opt('bravo',
                    'b',
                    'bravo help string',
                    store=int,
                    metavar='INT'),
                Opt('charlie', '', 'charlie help string', store=True),
                Opt('delta', '', 'delta help string', store=str)
            ]

        self.ui = self.shell
        self.cmd = TestOptions(name='cmd', ui=self.ui)
Exemplo n.º 3
0
 def tearDown(self):
     ShellBaseTest.tearDown(self)
Exemplo n.º 4
0
 def tearDown(self):
     ShellBaseTest.tearDown(self)