Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(17)  |  Call(17)  |  Derive(0)  |  Import(0)
Get backend class by name/alias

        def get_backend_cls(backend=None, loader=None):
    """Get backend class by name/alias"""
    backend = backend or 'disabled'
    loader = loader or current_app.loader
    aliases = dict(BACKEND_ALIASES, **loader.override_backends)
    try:
        return symbol_by_name(backend, aliases)
    except ValueError as exc:
        reraise(ValueError, ValueError(UNKNOWN_BACKEND.format(
            backend, exc)), sys.exc_info()[2])
        


src/c/e/celery-3.1.11/celery/tests/backends/test_backends.py   celery(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ImportError):
            backends.get_backend_cls('fasodaopjeqijwqe', self.app.loader)
 
    @depends_on_current_app
    def test_sym_raises_ValuError(self):
        with patch('celery.backends.symbol_by_name') as sbn:
            sbn.side_effect = ValueError()
            with self.assertRaises(ValueError):
                backends.get_backend_cls('xxx.xxx:foo', self.app.loader)

src/c/e/celery-HEAD/celery/tests/backends/test_backends.py   celery(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ImportError):
            backends.get_backend_cls('fasodaopjeqijwqe', self.app.loader)
 
    @depends_on_current_app
    def test_sym_raises_ValuError(self):
        with patch('celery.backends.symbol_by_name') as sbn:
            sbn.side_effect = ValueError()
            with self.assertRaises(ValueError):
                backends.get_backend_cls('xxx.xxx:foo', self.app.loader)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/celery/tests/backends/test_backends.py   antisocial(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ImportError):
            backends.get_backend_cls('fasodaopjeqijwqe')
 
    def test_default_backend(self):
    def test_sym_raises_ValuError(self):
        with patch('celery.backends.symbol_by_name') as sbn:
            sbn.side_effect = ValueError()
            with self.assertRaises(ValueError):
                backends.get_backend_cls('xxx.xxx:foo')

src/f/i/firefox-flicks-HEAD/vendor-local/lib/python/celery/tests/backends/test_backends.py   firefox-flicks(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ImportError):
            backends.get_backend_cls('fasodaopjeqijwqe')
 
    def test_default_backend(self):
    def test_sym_raises_ValuError(self):
        with patch('celery.backends.symbol_by_name') as sbn:
            sbn.side_effect = ValueError()
            with self.assertRaises(ValueError):
                backends.get_backend_cls('xxx.xxx:foo')

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/celery/tests/test_backends/__init__.py   socorro(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

src/o/p/openquake-packages-HEAD/celery/celery/tests/test_backends/__init__.py   openquake-packages(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

src/m/a/make.mozilla.org-HEAD/vendor-local/lib/python/celery/tests/test_backends/__init__.py   make.mozilla.org(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

src/o/h/oh-mainline-HEAD/vendor/packages/celery/celery/tests/test_backends/__init__.py   oh-mainline(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

src/m/o/mozillians-HEAD/vendor-local/lib/python/celery/tests/test_backends/__init__.py   mozillians(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

src/p/l/playdoh-lib-HEAD/lib/python/celery/tests/test_backends/__init__.py   playdoh-lib(Download)
    def test_unknown_backend(self):
        with self.assertRaises(ValueError):
            backends.get_backend_cls("fasodaopjeqijwqe")
 

  1 | 2  Next