[DB-SIG] DB API 2.0 Anal Compliance Unit Test for review

Stuart Bishop zen@shangri-la.dropbear.id.au
Sat, 15 Feb 2003 11:24:25 +1100


On Thursday, February 13, 2003, at 07:30  PM, M.-A. Lemburg wrote:

> * requiring a separate DB for the test suite is a bit much; I'd
>   suggest to use properly mangled table names instead, e.g.
>   dbapi20xxxxx with xxxxx being some number.
>
> * test_DBAPI20 should be renamed to e.g. DatabaseAPI20Test (which
>   is Python style compliant) and use unittest.TestCase
>   as base class.

Done.

> * the test for exceptions should also check the class
>   structure

If you mean 'make sure driver.NotImplementError is a subclass of
driver.Error', I've fixed this.

> *             
> self.failIfEqual(cur.description[0][1],self.driver.STRING,
>   should be
>             self.assertEqual(cur.description[0][1],self.driver.STRING,

Fixed.

> * I'd add a test to see whether .fetchall() returns
>   an empty list after the whole result set has been
>   fetched (fetch beyond end-of-result-set). .fetchone()
>   should return None, .fetchmany() also an empty list.

Done

> * Another would be to check whether .fetchxxx() methods return
>   .rowcount number of rows in total.

Done. Which made me notice something that needs clarification in the 
spec.
The docs for .rowcount should state 'Unless the driver promises 
otherwise,
it should never be assumed that the value of .rowcount is correct until
all results have been fetched'. This currently is only inferred through
footnote 7.

I've uploaded a new version to 
http://stuartbishop.net/Software/DBAPI20TestSuite/

-- 
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/