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', ])
def setup(self): self.out = WhateverIO() self.err = WhateverIO() self.cmd = Command(self.app, stdout=self.out, stderr=self.err)