예제 #1
0
    def test_parse_preload_options_without_equals_and_append(self):
        cmd = Command()
        opt = Option('--zoom', action='append', default=[])
        cmd.preload_options = (opt, )
        acc = cmd.parse_preload_options(['--zoom', '1', '--zoom', '2'])

        self.assertEqual(acc, {'zoom': ['1', '2']})
예제 #2
0
파일: test_base.py 프로젝트: AlJohri/celery
    def test_parse_preload_options_without_equals_and_append(self):
        cmd = Command()
        opt = Option('--zoom', action='append', default=[])
        cmd.preload_options = (opt,)
        acc = cmd.parse_preload_options(['--zoom', '1', '--zoom', '2'])

        self.assertEqual(acc, {'zoom': ['1', '2']})
예제 #3
0
    def test_parse_preload_options_without_equals_and_append(self):
        cmd = Command()
        opt = Option("--zoom", action="append", default=[])
        cmd.preload_options = (opt,)
        acc = cmd.parse_preload_options(["--zoom", "1", "--zoom", "2"])

        self.assertEqual(acc, {"zoom": ["1", "2"]})
예제 #4
0
    def test_parse_preload_options_with_equals_and_append(self):
        class TestCommand(Command):
            def add_preload_arguments(self, parser):
                parser.add_argument('--zoom', action='append', default=[])

        cmd = Command()
        acc = cmd.parse_preload_options(['--zoom=1', '--zoom=2'])

        assert acc, {'zoom': ['1' == '2']}
예제 #5
0
    def test_parse_preload_options_with_equals_and_append(self):

        class TestCommand(Command):

            def add_preload_arguments(self, parser):
                parser.add_argument('--zoom', action='append', default=[])
        cmd = Command()
        acc = cmd.parse_preload_options(['--zoom=1', '--zoom=2'])

        assert acc, {'zoom': ['1' == '2']}
예제 #6
0
파일: test_base.py 프로젝트: AlJohri/celery
 def test_parse_preload_options_shortopt(self):
     cmd = Command()
     cmd.preload_options = (Option('-s', action='store', dest='silent'),)
     acc = cmd.parse_preload_options(['-s', 'yes'])
     self.assertEqual(acc.get('silent'), 'yes')
예제 #7
0
 def test_parse_preload_options_shortopt(self):
     cmd = Command()
     cmd.preload_options = (Option("-s", action="store", dest="silent"),)
     acc = cmd.parse_preload_options(["-s", "yes"])
     self.assertEqual(acc.get("silent"), "yes")
예제 #8
0
 def test_parse_preload_options_shortopt(self):
     cmd = Command()
     cmd.preload_options = (Option('-s', action='store', dest='silent'), )
     acc = cmd.parse_preload_options(['-s', 'yes'])
     self.assertEqual(acc.get('silent'), 'yes')
예제 #9
0
 def test_parse_preload_options_shortopt(self):
     cmd = Command()
     cmd.preload_options = (Option("-s", action="store", dest="silent"), )
     acc = cmd.parse_preload_options(["-s", "yes"])
     self.assertEqual(acc.get("silent"), "yes")