コード例 #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
ファイル: test_base.py プロジェクト: Charles-Yurun/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"]})
コード例 #4
0
ファイル: test_base.py プロジェクト: yinlinzh/celery
    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
ファイル: test_base.py プロジェクト: pashinin/celery
    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
ファイル: test_base.py プロジェクト: AndrewBloody/DUBALU_SMS
 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
ファイル: test_base.py プロジェクト: westurner/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")