From e43f85965e516218fd2630dba5d46cbdc8e00e09 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 10 Feb 2011 15:03:11 -0500 Subject: - The path given as the location of a sqlite database is now normalized via os.path.abspath(), so that directory changes within the process don't affect the ultimate location of a relative file path. [ticket:2036] --- test/dialect/test_sqlite.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/dialect/test_sqlite.py') diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index efd616c3d..6b84c57ed 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -7,8 +7,9 @@ from sqlalchemy import * from sqlalchemy import exc, sql, schema, pool, types as sqltypes from sqlalchemy.dialects.sqlite import base as sqlite, \ pysqlite as pysqlite_dialect +from sqlalchemy.engine.url import make_url from test.lib import * - +import os class TestTypes(TestBase, AssertsExecutionResults): @@ -328,6 +329,13 @@ class DialectTest(TestBase, AssertsExecutionResults): pass raise + def test_file_path_is_absolute(self): + d = pysqlite_dialect.dialect() + eq_( + d.create_connect_args(make_url('sqlite:///foo.db')), + ([os.path.abspath('foo.db')], {}) + ) + def test_pool_class(self): e = create_engine('sqlite+pysqlite://') assert e.pool.__class__ is pool.SingletonThreadPool @@ -608,7 +616,7 @@ class MatchTest(TestBase, AssertsCompiledSQL): eq_([1, 3], [r.id for r in results]) -class TestAutoIncrement(TestBase, AssertsCompiledSQL): +class AutoIncrementTest(TestBase, AssertsCompiledSQL): def test_sqlite_autoincrement(self): table = Table('autoinctable', MetaData(), Column('id', Integer, -- cgit v1.2.1