Make the bind variables and fetch variables accessible although they need to be

treated carefully since they are used internally; return the cursor from
the execute() method as a convenience.
This commit is contained in:
Anthony Tuininga 2008-10-24 13:56:33 +00:00
parent 489db58509
commit 79f1483a28

View File

@ -67,19 +67,22 @@ class TestLongVar(BaseTestCase):
def testSetOutputSizesAll(self): def testSetOutputSizesAll(self):
"test setoutputsizes is valid (all)" "test setoutputsizes is valid (all)"
self.cursor.setoutputsize(25000) self.cursor.setoutputsize(25000)
longVar = self.cursor.execute(u"select * from TestLongRaws")[1] self.cursor.execute(u"select * from TestLongRaws")
longVar = self.cursor.fetchvars[1]
self.failUnlessEqual(longVar.maxlength, 25004) self.failUnlessEqual(longVar.maxlength, 25004)
def testSetOutputSizesWrongColumn(self): def testSetOutputSizesWrongColumn(self):
"test setoutputsizes is valid (wrong column)" "test setoutputsizes is valid (wrong column)"
self.cursor.setoutputsize(25000, 1) self.cursor.setoutputsize(25000, 1)
longVar = self.cursor.execute(u"select * from TestLongRaws")[1] self.cursor.execute(u"select * from TestLongRaws")
longVar = self.cursor.fetchvars[1]
self.failUnlessEqual(longVar.maxlength, 131072) self.failUnlessEqual(longVar.maxlength, 131072)
def testSetOutputSizesRightColumn(self): def testSetOutputSizesRightColumn(self):
"test setoutputsizes is valid (right column)" "test setoutputsizes is valid (right column)"
self.cursor.setoutputsize(35000, 2) self.cursor.setoutputsize(35000, 2)
longVar = self.cursor.execute(u"select * from TestLongs")[1] self.cursor.execute(u"select * from TestLongs")
longVar = self.cursor.fetchvars[1]
self.failUnlessEqual(longVar.maxlength, 70008) self.failUnlessEqual(longVar.maxlength, 70008)
def testArraySizeTooLarge(self): def testArraySizeTooLarge(self):