Browse files

Invalid SQL statement test

  • Loading branch information...
1 parent 01e070e commit 11a8fba0ed06ba4383ffd59b44f9c7bb1fed24d2 @nakagami committed Nov 20, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 firebirdsql/tests.py
View
6 firebirdsql/tests.py
@@ -52,11 +52,17 @@
conn.cursor().execute("update foo set c='Hajime' where a=1")
conn.cursor().execute("update foo set c=? where a=2", ['Nakagami'])
conn.commit()
+
cur = conn.cursor()
try:
conn.cursor().execute("insert into foo(a, b, c) values (1, 'a', 'b')")
except firebirdsql.IntegrityError:
pass
+ try:
+ conn.cursor().execute("bad sql")
+ except firebirdsql.OperationalError, e:
+ assert e.sql_code == -104
+
cur = conn.cursor()
cur.execute("select * from foo")
print(cur.description)

0 comments on commit 11a8fba

Please sign in to comment.