diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-17 15:35:30 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-17 15:35:30 +0000 |
commit | 1aebdb231f395aa68bd1767ffd897189107e070a (patch) | |
tree | 1cc759428e88e925a3318519dac0dda566c5b36f /test/dialect/informix.py | |
parent | a3f67fecb27363c73f833cc72cefbff5e8754598 (diff) | |
download | sqlalchemy-1aebdb231f395aa68bd1767ffd897189107e070a.tar.gz |
get basic compilation working for [ticket:972]
Diffstat (limited to 'test/dialect/informix.py')
-rw-r--r-- | test/dialect/informix.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/test/dialect/informix.py b/test/dialect/informix.py index 4a2546f17..1fbbaa0cb 100644 --- a/test/dialect/informix.py +++ b/test/dialect/informix.py @@ -4,12 +4,20 @@ from sqlalchemy.databases import informix from testlib import * -class BasicTest(TestBase, AssertsExecutionResults): - # A simple import of the database/ module should work on all systems. - def test_import(self): - # we got this far, right? - return True - +class CompileTest(TestBase, AssertsCompiledSQL): + __dialect__ = informix.InfoDialect() + + def test_statements(self): + meta =MetaData() + t1= Table('t1', meta, Column('col1', Integer, primary_key=True), Column('col2', String(50))) + t2= Table('t2', meta, Column('col1', Integer, primary_key=True), Column('col2', String(50)), Column('col3', Integer, ForeignKey('t1.col1'))) + + self.assert_compile(t1.select(), "SELECT t1.col1, t1.col2 FROM t1") + + self.assert_compile(select([t1, t2]).select_from(t1.join(t2)), "SELECT t1.col1, t1.col2, t2.col1, t2.col2, t2.col3 FROM t1 JOIN t2 ON t1.col1 = t2.col3") + self.assert_compile(t1.update().values({t1.c.col1 : t1.c.col1 + 1}), 'UPDATE t1 SET col1=(t1.col1 + ?)') + + if __name__ == "__main__": testenv.main() |