Skip to content

Commit

Permalink
Invalid SQL statement test
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Nov 20, 2010
1 parent 01e070e commit 11a8fba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions firebirdsql/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 11a8fba

Please sign in to comment.