Navigation Menu

Skip to content

Commit

Permalink
Added pgtests test_int_limits
Browse files Browse the repository at this point in the history
Test for issue 183.  Did not find a problem, but keeping the test.
  • Loading branch information
mkleehammer committed Sep 27, 2012
1 parent 5504740 commit b3e8648
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests2/pgtests.py
Expand Up @@ -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")
Expand Down

0 comments on commit b3e8648

Please sign in to comment.