
    	hE                     T    S r SSS rSrSSKrSSKrSr " S S	\R                  5      rg)
a  Python DB API 2.0 driver compliance unit test suite.

   This software is Public Domain and may be used without restrictions.

"Now we have booze and barflies entering the discussion, plus rumours of
 DBAs on drugs... and I won't tell you what flashes through my mind each
 time I read the subject line with 'Anal Compliance' in it.  All around
 this is turning out to be a thoroughly unwholesome unit test."

   -- Ian Bicking
z$Revision: 1.15.0 $   z'Stuart Bishop <stuart@stuartbishop.net>    NFc                   h   \ rS rSrSrSrSr0 rSrS\-  r	S\-  r
S\-  rS	\-  rS
rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS
rS r S r!S r"S r#S  r$S! r%/ S"Qr&S# r'S$ r(S% r)S& r*S' r+S( r,S) r-S* r.S+ r/S, r0S- r1S. r2S/ r3S0 r4S1 r5S2 r6S3 r7S4 r8S5 r9S6 r:S7 r;Sr<g)8DatabaseAPI20TestV   a  Test a database self.driver for DB API 2.0 compatibility.
This implementation tests Gadfly, but the TestCase
is structured so that other self.drivers can subclass this
test case to ensure compiliance with the DB-API. It is
expected that this TestCase may be expanded in the future
if ambiguities or edge conditions are discovered.

The 'Optional Extensions' are not yet being tested.

self.drivers should subclass this test, overriding setUp, tearDown,
self.driver, connect_args and connect_kw_args. Class specification
should be as follows:

import dbapi20
class mytest(dbapi20.DatabaseAPI20Test):
   [...]

Don't 'import DatabaseAPI20Test from dbapi20', or you will
confuse the unit tester - just 'import dbapi20'.
N dbapi20test_z'create table %sbooze (name varchar(20))z<create table %sbarflys (name varchar(20), drink varchar(30))zdrop table %sboozezdrop table %sbarflyslowerc                 :    UR                  U R                  5        g N)executeddl1selfcursors     hC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\adodbapi/test/dbapi20.pyexecuteDDL1DatabaseAPI20Test.executeDDL1|       tyy!    c                 :    UR                  U R                  5        g r   )r   ddl2r   s     r   executeDDL2DatabaseAPI20Test.executeDDL2   r   r   c                     g)zwself.drivers should override this method to perform required setup
if any is necessary, such as creating the database.
Nr   r   s    r   setUpDatabaseAPI20Test.setUp   s     	r   c                 v    U R                  5       n UR                  5       nU R                  U R                  4 H%  n UR	                  U5        UR                  5         M'     UR                  5         g! U R                  R                   a     MW  f = f! UR                  5         f = f! [         a     gf = f)zself.drivers should override this method to perform required cleanup
if any is necessary, such as deleting the test database.
The default drops the tables that may be created.
N)
_connectr   xddl1xddl2r   commitdriverErrorclose	Exception)r   concurddls       r   tearDownDatabaseAPI20Test.tearDown   s    
	--/Cjjl JJ

3CC(

 4 		  ;;,,  
 		 		sK   B+ +B !A5 B $B+ 5BB BB B((B+ +
B87B8c                      U R                   R                  " U R                  0 U R                  D6nU$ ! [         a    U R                  S5         W$ f = f)Nz-No connect method found in self.driver module)r$   connectconnect_argsconnect_kw_argsAttributeErrorfail)r   rs     r   r    DatabaseAPI20Test._connect   sY    	G##T%6%6O$:N:NOA   	GIIEF	Gs   04 AAc                 D    U R                  5       nUR                  5         g r   )r    r&   r   r(   s     r   test_connectDatabaseAPI20Test.test_connect   s    mmo		r   c                      U R                   R                  nU R                  US5        g ! [         a    U R	                  S5         g f = f)Nz2.0zDriver doesn't define apilevel)r$   apilevelassertEqualr1   r2   )r   r:   s     r   test_apilevelDatabaseAPI20Test.test_apilevel   sB    	8{{++HXu- 	8II67	8s   (+ A	A	c                      U R                   R                  nU R                  US;   5        g ! [         a    U R	                  S5         g f = f)N)r            z"Driver doesn't define threadsafety)r$   threadsafety
assertTruer1   r2   )r   rB   s     r   test_threadsafety#DatabaseAPI20Test.test_threadsafety   sC    	<;;33LOOLL89 	<II:;	<   *- A
Ac                      U R                   R                  nU R                  US;   5        g ! [         a    U R	                  S5         g f = f)N)qmarknumericnamedformatpyformatz Driver doesn't define paramstyle)r$   
paramstylerC   r1   r2   )r   rM   s     r   test_paramstyle!DatabaseAPI20Test.test_paramstyle   sI    	://JOOQQ  	:II89	:rF   c                 z   U R                  [        U R                  R                  [        5      5        U R                  [        U R                  R
                  [        5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        U R                  [        U R                  R                  U R                  R
                  5      5        g r   )rC   
issubclassr$   Warningr'   r%   InterfaceErrorDatabaseErrorOperationalErrorIntegrityErrorInternalErrorProgrammingErrorNotSupportedErrorr   s    r   test_Exceptions!DatabaseAPI20Test.test_Exceptions   sM   
4;;#6#6	BC
4;;#4#4i@A
4;;#=#=t{{?P?PQR
4;;#<#<dkk>O>OPQ
4;;#?#?ARARST
4;;#=#=t{{?P?PQR
4;;#<#<dkk>O>OPQ
4;;#?#?ARARST
4;;#@#@$++BSBSTUr   c                    U R                  5       nU R                  nU R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        U R                  UR
                  UR
                  L 5        U R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        U R                  UR                  UR                  L 5        g r   )r    r$   rC   rR   r%   rS   rT   rU   rV   rW   rX   rY   )r   r(   drvs      r   %test_ExceptionsAsConnectionAttributes7DatabaseAPI20Test.test_ExceptionsAsConnectionAttributes   s    mmokks{{23		SYY./**c.@.@@A))S->->>?,,0D0DDE**c.@.@@A))S->->>?,,0D0DDE--1F1FFGr   c                     U R                  5       n UR                  5         UR                  5         g ! UR                  5         f = fr   )r    r#   r&   r6   s     r   test_commitDatabaseAPI20Test.test_commit   s.    mmo	JJLIIKCIIK	   3 Ac                     U R                  5       n[        US5      (       a   UR                  5         g g ! U R                  R                   a     g f = f)Nrollback)r    hasattrre   r$   rY   r6   s     r   test_rollbackDatabaseAPI20Test.test_rollback   sM    mmo 3
## $ ;;00 s   5 AAc                     U R                  5       n UR                  5       nUR                  5         g ! UR                  5         f = fr   )r    r   r&   r   r(   r)   s      r   test_cursorDatabaseAPI20Test.test_cursor   s0    mmo	**,CIIKCIIKrc   c                    U R                  5       n UR                  5       nUR                  5       nU R                  U5        UR                  SU R                  -  5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      S5        U R                  [        US   5      S5        U R                  US   S   S5        UR                  5         g ! UR                  5         f = f)N.insert into %sbooze values ('Victoria Bitter')select name from %sboozer?   r   Victoria Bitter	r    r   r   r   table_prefixfetchallr;   lenr&   )r   r(   cur1cur2boozes        r   test_cursor_isolation'DatabaseAPI20Test.test_cursor_isolation   s    mmo	 ::<D::<DT"LL@DDUDUV LL3d6G6GGHMMOESZ+Sq]A.U1Xa[*;<IIKCIIKs   CC1 1Dc                    U R                  5       n UR                  5       nU R                  U5        U R                  UR                  S S5        UR                  SU R                  -  5        U R                  [        UR                  5      SS5        U R                  [        UR                  S   5      SS5        U R                  UR                  S   S   R                  5       SS	5        U R                  UR                  S   S   U R                  R                  S
UR                  S   S   -  5        U R                  U5        U R                  UR                  S S5        UR                  5         g ! UR                  5         f = f)Nzccursor.description should be none after executing a statement that can return no rows (such as DDL)ro   r?   z-cursor.description describes too many columnsr      z1cursor.description[x] tuples must have 7 elementsnamez0cursor.description[x][0] must return column namez8cursor.description[x][1] must return column type. Got %rzVcursor.description not being set to None when executing no-result statements (eg. DDL))r    r   r   r;   descriptionr   rr   rt   r
   r$   STRINGr   r&   rj   s      r   test_description"DatabaseAPI20Test.test_description  sb   mmo'	**,CS!B KK2T5F5FFGCOO$a)X COOA&'C
 "1%++-B
 "1%""J//!$Q'( S!1 IIKCIIKs   EE7 7F	c                 @   U R                  5       n UR                  5       nU R                  U5        U R                  UR                  S;   S5        UR                  SU R                  -  5        U R                  UR                  S;   S5        UR                  SU R                  -  5        U R                  UR                  S;   S5        U R                  U5        U R                  UR                  SS	5        UR                  5         g ! UR                  5         f = f)
Nr   zFcursor.rowcount should be -1 or 0 after executing no-result statementsrn   r   r?   zccursor.rowcount should == number or rows inserted, or set to -1 after executing an insert statementro   zbcursor.rowcount should == number of rows returned, or set to -1 after executing a select statementr   zJcursor.rowcount not being reset to -1 after executing no-result statements)
r    r   r   rC   rowcountr   rr   r   r;   r&   rj   s      r   test_rowcountDatabaseAPI20Test.test_rowcount=  s    mmo	**,CS!OO'
 KK@DDUDUV OO'@
 KK2T5F5FFGOO'?
 S!' IIKCIIKs   C(D Dc                 4   U R                  5       n UR                  5       nU R                  (       a  [        US5      (       a  UR	                  U R                  S5      nU R                  [        U5      S5        U R                  US   S5        UR                  5       nU R                  [        U5      SS5        U R                  [        US   5      SS5        U R                  US   S   SS	5        UR                  5         g ! UR                  5         f = f)
Ncallproc)FOOr?   r   r   zcallproc produced no result setz$callproc produced invalid result setfooz!callproc produced invalid results)	r    r   
lower_funcrf   r   r;   rt   rs   r&   r   r(   r)   r3   s       r   test_callprocDatabaseAPI20Test.test_callproca  s    mmo	**,C73
#;#;LL(;  Q+  1u-LLN  Q,MN  QqTA/UV  1a%1TUIIKCIIKs   C"D Dc                    U R                  5       n UR                  5       nUR                  5         U R                  U R                  R
                  U R                  U5        U R                  U R                  R
                  UR                  5        [        (       a1  U R                  U R                  R
                  UR                  5        g U R                  S5        g ! UR                  5         f = f)Nz>Non-idempotent close is considered a bad thing by some people.)
r    r   r&   assertRaisesr$   r%   r   r#   TEST_FOR_NON_IDEMPOTENT_CLOSEskipTestrj   s      r   
test_closeDatabaseAPI20Test.test_closep  s    mmo	**,CIIK 	$++++T-=-=sC 	$++++SZZ8 )(dkk//;MMP IIKs   C! !C3c                     U R                  5       n UR                  5       nU R                  U5        UR                  5         g ! UR                  5         f = fr   )r    r   _paraminsertr&   rj   s      r   test_executeDatabaseAPI20Test.test_execute  s>    mmo	**,Cc"IIKCIIKs   !A Ac                    U R                  U5        UR                  SU R                  -  5        U R                  UR                  S;   5        U R
                  R                  S:X  a   UR                  SU R                  -  S5        OU R
                  R                  S:X  a   UR                  SU R                  -  S5        OU R
                  R                  S:X  a"  UR                  S	U R                  -  S
S05        OU R
                  R                  S:X  a   UR                  SU R                  -  S5        OMU R
                  R                  S:X  a"  UR                  SU R                  -  S
S05        OU R                  S5        U R                  UR                  S;   5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      SS5        US   S   US   S   /nUR                  5         U R                  US   SS5        U R                  US   SS5        SnU R                  US   S   USUS   S   < SU< 35        U R                  US   S   USUS   S   < SU< 35        g )NzSinsert into %sbarflys values ('Victoria Bitter', 'thi%%s :may ca%%(u)se? troub:1e')r   rH   zCinsert into %sbarflys values (?, 'thi%%s :may ca%%(u)se? troub:1e')Cooper'srI   zDinsert into %sbarflys values (:1, 'thi%%s :may ca%%(u)se? troub:1e')rJ   zGinsert into %sbarflys values (:beer, 'thi%%s :may ca%%(u)se? troub:1e')beerr   rK   zEinsert into %sbarflys values (%%s, 'thi%%s :may ca%%(u)se? troub:1e')rL   zKinsert into %sbarflys values (%%(beer)s, 'thi%%s :may ca%%(u)se? troub:1e')zInvalid paramstylez!select name, drink from %sbarflysr@   z%cursor.fetchall returned too few rowsr   r?   zFcursor.fetchall retrieved incorrect data, or data inserted incorrectlyrp   zthi%s :may ca%(u)se? troub:1ezLcursor.fetchall retrieved incorrect data, or data inserted incorrectly. Got=z, Expected=)r   r   rr   rC   r   r$   rM   r2   rs   r;   rt   sort)r   r)   resbeerstroubles        r   r   DatabaseAPI20Test._paraminsert  s   a  "	
 	/0;;!!W,KKU##$
 [[##y0KKV##$
 [[##w.KKY##$$
 [[##x/KKW##$
 [[##z1KK]##$$ II*+/07$:K:KKLllnS1&MNQCF1I&

!HT	

 	!HT	

 2F1I  #Aq	}K{D	
 	F1I  #Aq	}K{D	
r   c                    U R                  5       n UR                  5       nU R                  U5        SS/nSS0SS0/nU R                  R                  S:X  a   UR                  SU R                  -  U5        OU R                  R                  S:X  a   UR                  S	U R                  -  U5        OU R                  R                  S
:X  a   UR                  SU R                  -  U5        OU R                  R                  S:X  a   UR                  SU R                  -  U5        OKU R                  R                  S:X  a   UR                  SU R                  -  U5        OU R                  S5        U R                  UR                  S;   SUR                  -  5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      SS5        US   S   US   S   /nUR                  5         U R                  US   SSUS   -  5        U R                  US   SS5        UR                  5         g ! UR                  5         f = f)Nr   )Boag'sr   r   r   rH   zinsert into %sbooze values (?)rI   zinsert into %sbooze values (:1)rJ   z"insert into %sbooze values (:beer)rK   z insert into %sbooze values (%%s)rL   z&insert into %sbooze values (%%(beer)s)zUnknown paramstyle)r   r@   zIinsert using cursor.executemany set cursor.rowcount to incorrect value %rro   r@   z2cursor.fetchall retrieved incorrect number of rowsr   r?   zincorrect data "%s" retrievedzincorrect data retrieved)r    r   r   r$   rM   executemanyrr   r2   rC   r   r   rs   r;   rt   r   r&   )r   r(   r)   largsmargsr   r   s          r   test_executemany"DatabaseAPI20Test.test_executemany  s#   mmo-	**,CS!"K0Ej)FH+=>E{{%%04t7H7HH% ''9458I8II5 ''7284;L;LLe ''8369J9JJE '':5<@Q@QR
 		./OO'%'*||4
 KK2T5F5FFG,,.CC!Q VAYAq	*EJJLa($CeAh$N U1Xz3MNIIKCIIKs   H(I Ic                    U R                  5       n UR                  5       nU R                  U R                  R                  UR
                  5        U R                  U5        U R                  U R                  R                  UR
                  5        UR                  SU R                  -  5        U R                  UR                  5       S S5        U R                  UR                  S;   5        UR                  SU R                  -  5        U R                  U R                  R                  UR
                  5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      SS5        U R                  US   SS	5        U R                  UR                  5       S S
5        U R                  UR                  S;   5        UR                  5         g ! UR                  5         f = f)Nro   z?cursor.fetchone should return None if a query retrieves no rowsr   rn   r?   z2cursor.fetchone should have retrieved a single rowr   rp   z(cursor.fetchone retrieved incorrect dataz<cursor.fetchone should return None if no more rows availabler   )r    r   r   r$   r%   fetchoner   r   rr   r;   rC   r   rt   r&   r   s       r   test_fetchoneDatabaseAPI20Test.test_fetchone  s   mmo*	**,C dkk//> S!dkk//>KK2T5F5FFGQ
 OOCLLG34 KK@DDUDUV dkk//>KK2T5F5FFGAAO !')S N
 OOCLLG34IIKCIIKs   GG. .H )zCarlton ColdzCarlton DraftzMountain GoatRedbackrp   XXXXc                 n    U R                    Vs/ s H  nSU R                  < SU< S3PM     nnU$ s  snf )zCReturn a list of sql commands to setup the DB for the fetch
tests.
zinsert into zbooze values ('z'))samplesrr   )r   spopulates      r   	_populateDatabaseAPI20Test._populate?  s?     \\
! 483D3DaH! 	 
 	
s   2c                 .   U R                  5       n UR                  5       nU R                  U R                  R                  UR
                  S5        U R                  U5        U R                  5        H  nUR                  U5        M     UR                  SU R                  -  5        UR                  5       nU R                  [        U5      SS5        SUl        UR                  S5      nU R                  [        U5      SS5        UR                  S5      nU R                  [        U5      SS5        UR                  S5      nU R                  [        U5      S	S
5        U R                  UR                  S;   5        SUl        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      SS5        UR                  5       nU R                  [        U5      S5        UR                  5       nU R                  [        U5      S	5        U R                  UR                  S;   5        SUl        UR                  SU R                  -  5        UR                  5       nU R                  UR                  S;   5        U R                  [        U5      S5        U R                  [        U5      S5        U Vs/ s H  oDS	   PM	     nnUR                  5         [!        S	S5       H%  nU R                  XV   U R"                  U   S5        M'     UR                  5       nU R                  [        U5      S	S5        U R                  UR                  S;   5        U R%                  U5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      S	S5        U R                  UR                  S;   5        UR'                  5         g s  snf ! UR'                  5         f = f)N   ro   r?   zQcursor.fetchmany retrieved incorrect number of rows, default of arraysize is one.
   rA   z3cursor.fetchmany retrieved incorrect number of rowsr@   r   zLcursor.fetchmany should return an empty sequence after results are exhaustedr      z0cursor.arraysize not being honoured by fetchmanyr   z,incorrect data retrieved by cursor.fetchmanyzfcursor.fetchmany should return an empty sequence if called after the whole result set has been fetchedselect name from %sbarflyszKcursor.fetchmany should return an empty sequence if query retrieved no rowsr   )r    r   r   r$   r%   	fetchmanyr   r   r   rr   r;   rt   	arraysizerC   r   r   ranger   r   r&   )r   r(   r)   sqlr3   rowsis          r   test_fetchmany DatabaseAPI20Test.test_fetchmanyI  sf   mmoX	**,C dkk//BS!~~'C  ( KK2T5F5FFGAA/ CMa AAP a AAP a AA( OOCLLG34 CMKK2T5F5FFGAAM ASVQ'ASVQ'OOCLLG34CMKK2T5F5FFG==?DOOCLLG34SY*SY*"&'$QaD$D'IIK 1a[  GLLOB ! ==?DD	E OOCLLG34S!KK4t7H7HHIAA* OOCLLG34 IIKA (@ IIKs   KP O="D
P =P Pc                 t   U R                  5       n UR                  5       nU R                  U R                  R                  UR
                  5        U R                  U5        U R                  5        H  nUR                  U5        M     U R                  U R                  R                  UR
                  5        UR                  SU R                  -  5        UR                  5       nU R                  UR                  S[        U R                  5      4;   5        U R                  [        U5      [        U R                  5      S5        U Vs/ s H  oUS   PM	     nnUR                  5         [!        S[        U R                  5      5       H%  nU R                  XF   U R                  U   S5        M'     UR                  5       nU R                  [        U5      SS5        U R                  UR                  S[        U R                  5      4;   5        U R#                  U5        UR                  SU R                  -  5        UR                  5       nU R                  UR                  S;   5        U R                  [        U5      SS	5        UR%                  5         g s  snf ! UR%                  5         f = f)
Nro   r   z)cursor.fetchall did not retrieve all rowsr   z(cursor.fetchall retrieved incorrect rowszacursor.fetchall should return an empty list if called after the whole result set has been fetchedr   r   zMcursor.fetchall should return an empty list if a select query returns no rows)r    r   r   r$   r%   rs   r   r   r   rr   rC   r   rt   r   r;   r   r   r   r&   )r   r(   r)   r   r   r3   r   s          r   test_fetchallDatabaseAPI20Test.test_fetchall  s   mmo2	**,C dkk//>S!~~'C  (
 dkk//>KK2T5F5FFG<<>DOOCLLRT\\1B,CCDD	DLL!;
 #''$QaD$D'IIK1c$,,/0  GT\\!_.X 1 <<>DD	> OOCLLRT\\1B,CCDS!KK4t7H7HHI<<>DOOCLLG34D	1 IIK7 (6 IIKs   D=J% J D2J%  J% %J7c                    U R                  5       n UR                  5       nU R                  U5        U R                  5        H  nUR	                  U5        M     UR	                  SU R
                  -  5        UR                  5       nUR                  S5      nUR                  5       nUR                  5       nU R                  UR                  S;   5        U R                  [        U5      SS5        U R                  [        U5      SS5        US   /nUR                  US   S   US   S   /5        UR                  US   5        UR                  US   S   US   S   /5        UR                  5         [!        S[        U R"                  5      5       H%  n	U R                  X   U R"                  U	   S5        M'     UR%                  5         g ! UR%                  5         f = f)	Nro   r@   r   z+fetchmany returned incorrect number of rowsz*fetchall returned incorrect number of rowsr   r?   z$incorrect data retrieved or inserted)r    r   r   r   r   rr   r   r   rs   rC   r   r;   rt   extendappendr   r   r   r&   )
r   r(   r)   r   rows1rows23rows4rows56r   r   s
             r   test_mixedfetch!DatabaseAPI20Test.test_mixedfetch  s   mmo	**,CS!~~'C  ( KK2T5F5FFGLLNE]]1%FLLNE\\^FOOCLLG34FQ M FQ L !H:DKK1vay|45KKa!KK1vay|45IIK1c$,,/0  GT\\!_.T 1
 IIKCIIKs   F.G G#c                     [        S5      e)zShould create a procedure called deleteme
that returns two result sets, first the
number of rows in booze then "name from booze"
Helper not implementedNotImplementedErrorr   r)   s     r   help_nextset_setUp$DatabaseAPI20Test.help_nextset_setUp  s    
 "":;;r   c                     [        S5      e)z*If cleaning up is needed after nextSetTestr   r   r   s     r   help_nextset_tearDown'DatabaseAPI20Test.help_nextset_tearDown  s    !":;;r   c                     [        S5      e)Nz"Drivers need to override this testr   r   s    r   test_nextsetDatabaseAPI20Test.test_nextset  s    !"FGGr   c                     U R                  5       n UR                  5       nU R                  [        US5      S5        UR	                  5         g ! UR	                  5         f = f)Nr   z cursor.arraysize must be defined)r    r   rC   rf   r&   rj   s      r   test_arraysize DatabaseAPI20Test.test_arraysize  sK    mmo	**,COO[)+M IIKCIIKs   ,A A!c                     U R                  5       n UR                  5       nUR                  S5        U R                  U5        UR	                  5         g ! UR	                  5         f = f)N)   )r    r   setinputsizesr   r&   rj   s      r   test_setinputsizes$DatabaseAPI20Test.test_setinputsizes  sL    mmo	**,Ce$c"IIKCIIKs   2A A'c                     U R                  5       n UR                  5       nUR                  S5        UR                  SS5        U R                  U5        UR	                  5         g ! UR	                  5         f = f)Ni  i  r   )r    r   setoutputsizer   r&   rj   s      r   test_setoutputsize_basic*DatabaseAPI20Test.test_setoutputsize_basic'  s\    mmo	**,Cd#dA&c"IIKCIIKs   AA' 'A9c                     [        S5      e)Nz#Driver needed to override this testr   r   s    r   test_setoutputsize$DatabaseAPI20Test.test_setoutputsize2  s    !"GHHr   c                    U R                  5       n UR                  5       nU R                  U5        UR                  SU R                  -  5        UR                  SU R                  -  5        UR                  5       nU R                  [        U5      S5        U R                  [        US   5      S5        U R                  US   S   S S5        UR                  5         g ! UR                  5         f = f)Nz!insert into %sbooze values (NULL)ro   r?   r   zNULL value not returned as Nonerq   r   s       r   	test_NoneDatabaseAPI20Test.test_None6  s    mmo
	**,CS!KK;d>O>OOPKK2T5F5FFGASVQ'S1Y*QqT!Wd,MNIIKCIIKs   B?C" "C4c                     U R                   R                  SSS5      nU R                   R                  [        R                  " S5      5      ng )N     r   )	r   r   r   r   r   r   r   r   r   )r$   DateDateFromTickstimemktime)r   d1d2s      r   	test_DateDatabaseAPI20Test.test_DateD  s8    [[dB+[[&&t{{3S'TUr   c                     U R                   R                  SSS5      nU R                   R                  [        R                  " S5      5      ng )N   -      )	i  r?   r?   r   r   r   r   r   r   )r$   TimeTimeFromTicksr   r   r   t1t2s      r   	test_TimeDatabaseAPI20Test.test_TimeJ  s8    [[b"b)[[&&t{{3T'UVr   c                     U R                   R                  SSSSSS5      nU R                   R                  [        R                  " S5      5      ng )Nr   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )r$   	TimestampTimestampFromTicksr   r   r   s      r   test_Timestamp DatabaseAPI20Test.test_TimestampP  sA    [[""4RR<[[++KK;<
r   c                 p    U R                   R                  S5      nU R                   R                  S5      ng )Ns	   Somethingr   )r$   Binary)r   bs     r   test_BinaryDatabaseAPI20Test.test_BinaryX  s*    KK|,KKs#r   c                 P    U R                  [        U R                  S5      S5        g )Nr~   zmodule.STRING must be definedrC   rf   r$   r   s    r   test_STRINGDatabaseAPI20Test.test_STRING\  s    X68WXr   c                 P    U R                  [        U R                  S5      S5        g )NBINARYzmodule.BINARY must be defined.r  r   s    r   test_BINARYDatabaseAPI20Test.test_BINARY_      DKK*,L	
r   c                 P    U R                  [        U R                  S5      S5        g )NNUMBERzmodule.NUMBER must be defined.r  r   s    r   test_NUMBERDatabaseAPI20Test.test_NUMBERd  r  r   c                 P    U R                  [        U R                  S5      S5        g )NDATETIMEz module.DATETIME must be defined.r  r   s    r   test_DATETIMEDatabaseAPI20Test.test_DATETIMEi  s    DKK,.P	
r   c                 P    U R                  [        U R                  S5      S5        g )NROWIDzmodule.ROWID must be defined.r  r   s    r   
test_ROWIDDatabaseAPI20Test.test_ROWIDn  s    W57VWr   )=__name__
__module____qualname____firstlineno____doc__r$   r/   r0   rr   r   r   r!   r"   	lowerfuncr   r   r   r+   r    r7   r<   rD   rN   rZ   r^   ra   rg   rk   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r"  __static_attributes__r   r   r   r   r   V   sF   . FLO!L4|CDILXD </E"\1EI"",8<	:VH&&)V D J0E
N/b,\GZx4lB<<
H		IVW
$Y





Xr   r   )r(  __version__
__author__r   unittestr   TestCaser   r   r   r   <module>r/     sB   
 $Br*6
   !& BYX)) YXr   