diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-12-29 23:41:04 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-12-29 23:41:04 +0000 |
commit | 2698c8facbdb3e7fdb04d933a6541fc4bcc71cf6 (patch) | |
tree | ece3f66e84d258f7e9c8ec713b775cce71abbdab /test/dialect/test_postgresql.py | |
parent | d732e7bf261504f34c9b9d5049a9875633c3e4b3 (diff) | |
download | sqlalchemy-2698c8facbdb3e7fdb04d933a6541fc4bcc71cf6.tar.gz |
- postgresql dialect can properly detect pg "devel" version
strings, i.e. "8.5devel" [ticket:1636]
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r-- | test/dialect/test_postgresql.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index fdc2e7ea9..bc181810e 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -978,7 +978,25 @@ class MiscTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL): assert t2.c.date2.type.timezone is False finally: m1.drop_all() - + + def test_version_parsing(self): + class MockConn(object): + def __init__(self, res): + self.res = res + + def execute(self, str): + return self + + def scalar(self): + return self.res + + for string, version in [ + ("PostgreSQL 8.3.8 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)", (8, 3, 8)), + ("PostgreSQL 8.5devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2, 64-bit", (8, 5)), + ]: + + eq_(testing.db.dialect._get_server_version_info(MockConn(string)), version) + def test_pg_weirdchar_reflection(self): meta1 = MetaData(testing.db) subject = Table("subject", meta1, |