From eadd7c045c996c5e1963138593be6222068b4239 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 19 Nov 2009 17:22:53 +0800 Subject: [PATCH] Adding broken mod() test --- pyfpdb/test_Database.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyfpdb/test_Database.py b/pyfpdb/test_Database.py index 9283f46d..d7fcc43c 100644 --- a/pyfpdb/test_Database.py +++ b/pyfpdb/test_Database.py @@ -49,3 +49,18 @@ def testSQLiteFloorFunction(): print "DEBUG: int(var): %s" % int(i[0]) assert answer == int(i[0]) answer = answer + 1 + cur.execute("DROP TABLE test") + +def testSQLiteModFunction(): + vars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17, 18] + cur.execute("CREATE TABLE test(i float)") + for var in vars: + cur.execute("INSERT INTO test(i) values(%i)" % var) + cur.execute("SELECT mod(i,13) from test") + result = cur.fetchall() + answer = 0 + for i in result: + print "DEBUG: int(var): %s" % i[0] + assert answer == i[0] + answer = answer + 1 + cur.execute("DROP TABLE test")