From 2698c8facbdb3e7fdb04d933a6541fc4bcc71cf6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 29 Dec 2009 23:41:04 +0000 Subject: - postgresql dialect can properly detect pg "devel" version strings, i.e. "8.5devel" [ticket:1636] --- test/dialect/test_postgresql.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'test/dialect/test_postgresql.py') 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, -- cgit v1.2.1