[DB-SIG] DB API 2.0 Anal Compliance Unit Test for review
Matthew T. Kromer
matt@zope.com
Fri, 14 Feb 2003 14:09:37 -0500
Dittmar, Daniel wrote:
>I'm having problems with the following test from test_description:
>
> self.failIfEqual(cur.description[0][1],self.driver.STRING,
> 'cursor.description[x][1] must return column type. Got %r'
> % cur.description[0][1]
> )
>
>Aren't the driver's type objects like STRING supposed to compare equal to the second field of a description tuple?
>
>Daniel
>
>
>
Yes, as Marc-Andre already pointed out, this should be
self.assertEqual(self.driver.STRING,cur.description[0][1],
'cursor.description[x][1] must return column type. Got %r'
% cur.description[0][1]
)
I reversed the arguments to make the STRING constant first, not that it
really matters much, but the __cmp__ handler doesn't have to be retried
with swapped arguments that way.