コード例 #1
0
ファイル: test_celery.py プロジェクト: aarki/pyramid_celery
def test_preload_options():
    from pyramid_celery import celery_app
    from celery.bin.celery import Command

    with mock.patch('pyramid_celery.bootstrap') as boot:
        cmd = Command(celery_app)
        cmd.setup_app_from_commandline(['--ini', 'tests/configs/dev.ini'])
        boot.assert_called_with('tests/configs/dev.ini')

    with mock.patch('pyramid_celery.bootstrap') as boot:
        cmd = Command(celery_app)
        cmd.setup_app_from_commandline([
            '--ini',
            'tests/configs/dev.ini',
            '--ini-var',
            'foo=bar',
            '--ini-var=bar=baz',
        ])
コード例 #2
0
ファイル: test_celery.py プロジェクト: csunny/celery
 def setup(self):
     self.out = WhateverIO()
     self.err = WhateverIO()
     self.cmd = Command(self.app, stdout=self.out, stderr=self.err)