Permalink
Browse files

Added pgtests test_int_limits

Test for issue 183.  Did not find a problem, but keeping the test.
  • Loading branch information...
1 parent 5504740 commit b3e8648dcf1d6e6039cd0c995ea3ff620de85013 @mkleehammer committed Sep 27, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests2/pgtests.py
View
@@ -396,6 +396,18 @@ def test_row_repr(self):
self.assertEqual(result, "(1,)")
+ def test_int_limits(self):
+ values = [ (-sys.maxint - 1), -1, 0, 1, 3230392212, sys.maxint ]
+
+ self.cursor.execute("create table t1(a bigint)")
+
+ for value in values:
+ self.cursor.execute("delete from t1")
+ self.cursor.execute("insert into t1 values(?)", value)
+ v = self.cursor.execute("select a from t1").fetchone()[0]
+ self.assertEqual(v, value)
+
+
def main():
from optparse import OptionParser
parser = OptionParser(usage="usage: %prog [options] connection_string")

0 comments on commit b3e8648

Please sign in to comment.