mirror of https://github.com/celery/kombu.git
Add a new test file for the SQLAlchemy transport
Add a simple test to parse URLs for SQLAlchemy. This tests should prevent
issues that were introduced (GH-127 and the one fixed by f187ccdbcf
)
This commit is contained in:
parent
0c2c1ea2a3
commit
f301056b71
|
@ -0,0 +1,24 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import tempfile
|
||||
|
||||
from kombu.connection import BrokerConnection
|
||||
from kombu.tests.utils import TestCase
|
||||
|
||||
class test_sqlalchemy(TestCase):
|
||||
|
||||
def test_url_parser(self):
|
||||
from kombu.transport import sqlalchemy
|
||||
|
||||
tmppath = tempfile.mkdtemp()
|
||||
|
||||
url = "sqlalchemy+sqlite://{path}/celerydb.sqlite".format(path=tmppath)
|
||||
connection = BrokerConnection(url).connect()
|
||||
|
||||
url = "sqla+sqlite://{path}/celerydb.sqlite".format(path=tmppath)
|
||||
connection = BrokerConnection(url).connect()
|
||||
|
||||
# Should prevent regression fixed by f187ccd
|
||||
url = "sqlb+sqlite://{path}/celerydb.sqlite".format(path=tmppath)
|
||||
with self.assertRaises(KeyError):
|
||||
BrokerConnection(url).connect()
|
Loading…
Reference in New Issue