diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-10 15:03:11 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-10 15:03:11 -0500 |
commit | e43f85965e516218fd2630dba5d46cbdc8e00e09 (patch) | |
tree | a32d157bd8796cf888d15dda1cceb463e8ae434a /test/dialect/test_sqlite.py | |
parent | 3f9a343d725eea883aba2145de4cbb7b84f9d08c (diff) | |
download | sqlalchemy-e43f85965e516218fd2630dba5d46cbdc8e00e09.tar.gz |
- 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]
Diffstat (limited to 'test/dialect/test_sqlite.py')
-rw-r--r-- | test/dialect/test_sqlite.py | 12 |
1 files changed, 10 insertions, 2 deletions
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, |