diff options
| author | Jason Kirtland <jek@discorporate.us> | 2008-03-07 16:56:37 +0000 |
|---|---|---|
| committer | Jason Kirtland <jek@discorporate.us> | 2008-03-07 16:56:37 +0000 |
| commit | aa033afeeedd4d41493819312d652041017abf72 (patch) | |
| tree | 2950637d74d991a2892d6cf58bc005691494f209 /test/sql/generative.py | |
| parent | 90a7553b5be6abada946edb2cfbe6b4ee5e3b18c (diff) | |
| download | sqlalchemy-aa033afeeedd4d41493819312d652041017abf72.tar.gz | |
Added support for vendor-extended INSERT syntax like INSERT DELAYED INTO
Diffstat (limited to 'test/sql/generative.py')
| -rw-r--r-- | test/sql/generative.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/sql/generative.py b/test/sql/generative.py index 5e6b3b7e6..3d7c88972 100644 --- a/test/sql/generative.py +++ b/test/sql/generative.py @@ -510,5 +510,50 @@ class SelectTest(TestBase, AssertsCompiledSQL): self.assert_compile(select_copy, "SELECT FOOBER table1.col1, table1.col2, table1.col3 FROM table1") self.assert_compile(s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1") + +class InsertTest(TestBase, AssertsCompiledSQL): + """Tests the generative capability of Insert""" + + # fixme: consolidate converage from elsewhere here and expand + + def setUpAll(self): + global t1, t2 + t1 = table("table1", + column("col1"), + column("col2"), + column("col3"), + ) + t2 = table("table2", + column("col1"), + column("col2"), + column("col3"), + ) + + def test_prefixes(self): + i = t1.insert() + self.assert_compile(i, + "INSERT INTO table1 (col1, col2, col3) " + "VALUES (:col1, :col2, :col3)") + + gen = i.prefix_with("foober") + self.assert_compile(gen, + "INSERT foober INTO table1 (col1, col2, col3) " + "VALUES (:col1, :col2, :col3)") + + self.assert_compile(i, + "INSERT INTO table1 (col1, col2, col3) " + "VALUES (:col1, :col2, :col3)") + + i2 = t1.insert(prefixes=['squiznart']) + self.assert_compile(i2, + "INSERT squiznart INTO table1 (col1, col2, col3) " + "VALUES (:col1, :col2, :col3)") + + gen2 = i2.prefix_with("quux") + self.assert_compile(gen2, + "INSERT squiznart quux INTO " + "table1 (col1, col2, col3) " + "VALUES (:col1, :col2, :col3)") + if __name__ == '__main__': testenv.main() |
