コード例 #1
0
ファイル: test_conf.py プロジェクト: pombredanne/pecancelery
    def test_celery_imports_module(self):
        """
        Ensure that if CELERY_IMPORTS is specified manually in pecan config,
        it's actually used
        """     
        conf = configuration.initconf()
        conf.update_with_module('standard')

        from pecancelery import conf
        app = celery.Celery()
        for k, v in app.loader.conf.items():
            if k == 'CELERY_IMPORTS':
                self.assertEqual(dict(conf)[k], ('package.module.tasks',))
コード例 #2
0
ファイル: test_conf.py プロジェクト: pombredanne/pecancelery
    def test_single_config(self):
        """
        Ensure that if the configuration file includes celery-specific
        config, the parsed config object includes it
        """
        conf = configuration.initconf()
        conf.update_with_module('empty')

        from pecancelery import conf
        app = celery.Celery()
        for k, v in app.loader.conf.items():
            if k == 'BROKER_HOST':
                self.assertEqual(dict(conf)[k], 'example.com')
            else:
                self.assertEqual(dict(conf)[k], v)