diff --git a/test/CursorVar.py b/test/CursorVar.py index 8624f3c..5d8d686 100644 --- a/test/CursorVar.py +++ b/test/CursorVar.py @@ -37,7 +37,7 @@ class TestCursorVar(BaseTestCase): cursor(select IntCol + 1 from dual) CursorValue from TestNumbers order by IntCol""") - size = len(struct.pack("i", 1)) + size = struct.calcsize('P') self.failUnlessEqual(self.cursor.description, [ ('INTCOL', cx_Oracle.NUMBER, 10, 22, 9, 0, 0), ('CURSORVALUE', cx_Oracle.CURSOR, -1, size, 0, 0, 1) ]) diff --git a/test/uCursorVar.py b/test/uCursorVar.py index 669af65..3b41fb2 100644 --- a/test/uCursorVar.py +++ b/test/uCursorVar.py @@ -1,5 +1,6 @@ """Module for testing cursor variables.""" +import struct import sys class TestCursorVar(BaseTestCase): @@ -36,10 +37,7 @@ class TestCursorVar(BaseTestCase): cursor(select IntCol + 1 from dual) CursorValue from TestNumbers order by IntCol""") - if len(str(sys.maxint)) == 10: - size = 4 - else: - size = 8 + size = struct.calcsize('P') self.failUnlessEqual(self.cursor.description, [ (u'INTCOL', cx_Oracle.NUMBER, 10, 22, 9, 0, 0), (u'CURSORVALUE', cx_Oracle.CURSOR, -1, size, 0, 0, 1) ])