%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/sqlite3/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/sqlite3/test/userfunctions.pyo


Oac@sddlZddlZddlmZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdd.dYZdd/dYZdd0dYZdd1dYZdd2dYZdd3dYZdd4dYZdejfd YZd!ejfd"YZd#ejfd$YZd%efd&YZd'efd(YZd)efd*YZ d+Z!d,Ze"d-krendS(5iN(ttest_supportcCsdS(Ntfoo((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returntextscCsdS(Nubar((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnunicodescCsdS(Ni*((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnint!scCsdS(NgQ	@((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnfloat#scCsdS(N(tNone(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnnull%scCs!tjtdSWdQXdS(Ntblob(Rtcheck_py3k_warningstbuffer(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnblob's
cCsdS(NiiI((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_returnlonglong*scCsdddS(Nii((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_raiseexception,scCst|tkS(N(ttypetunicode(tv((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt
func_isstring/scCst|tkS(N(Rtint(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt
func_isint1scCst|tkS(N(Rtfloat(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_isfloat3scCst|tdkS(N(RR(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_isnone5scCst|tkS(N(RR
(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_isblob7scCst|ttfo|dkS(NiiI(t
isinstanceRtlong(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfunc_islonglong9st
AggrNoStepcBseZdZdZRS(cCsdS(N((tself((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt__init__=scCsdS(Ni((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfinalize@s(t__name__t
__module__RR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR<s	tAggrNoFinalizecBseZdZdZRS(cCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRDscCsdS(N((Rtx((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytstepGs(RR RR#(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR!Cs	tAggrExceptionInInitcBs#eZdZdZdZRS(cCsdddS(Nii((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRKscCsdS(N((RR"((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR#NscCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRQs(RR RR#R(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR$Js		tAggrExceptionInStepcBs#eZdZdZdZRS(cCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRUscCsdddS(Nii((RR"((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR#XscCsdS(Ni*((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR[s(RR RR#R(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR%Ts		tAggrExceptionInFinalizecBs#eZdZdZdZRS(cCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR_scCsdS(N((RR"((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR#bscCsdddS(Nii((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRes(RR RR#R(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR&^s		t
AggrCheckTypecBs#eZdZdZdZRS(cCs
d|_dS(N(Rtval(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRiscCsRitd6td6td6tdd6td6}t||t|k|_dS(NtstrRRRR(RRRRRR
R((Rt	whichTypeR(ttheType((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR#ls/cCs|jS(N(R((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRps(RR RR#R(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR'hs		tAggrSumcBs#eZdZdZdZRS(cCs
d|_dS(Ng(R((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRtscCs|j|7_dS(N(R((RR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR#wscCs|jS(N(R((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRzs(RR RR#R(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR,ss		t
FunctionTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZRS(cCsJtjd|_|jjddt|jjddt|jjddt|jjddt|jjddt|jjddt	|jjd	dt
|jjd
dt|jjddt|jjd
dt
|jjddt|jjddt|jjddt|jjddtdS(Ns:memory:t
returntextit
returnunicodet	returninttreturnfloatt
returnnullt
returnblobtreturnlonglongtraiseexceptiontisstringitisinttisfloattisnonetisblobt
islonglong(tsqlitetconnecttcontcreate_functionRRRRRRRR
RRRRRR(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytsetUp~scCs|jjdS(N(R>tclose(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyttearDownscCsEy*|jjddd|jdWntjk
r@nXdS(NtblaicSsd|S(Ni((R"((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt<lambda>ts&should have raised an OperationalError(R>R?tfailR<tOperationalError(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncErrorOnCreates
cCsUd}|}|td<|jjdd||jj}|jddS(NcSs
d}|S(NcSsdS(Ni((((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytfs((RI((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytgetfuncs	Rtreftestisselect reftest()(tglobalsR>R?tcursortexecute(RRJRItcur((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncRefCounts		
cCsV|jj}|jd|jd}|jt|t|j|ddS(Nsselect returntext()iR(R>RMRNtfetchonetassertEqualRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnTexts

cCsV|jj}|jd|jd}|jt|t|j|ddS(Nsselect returnunicode()iubar(R>RMRNRQRRRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnUnicodes

cCsV|jj}|jd|jd}|jt|t|j|ddS(Nsselect returnint()ii*(R>RMRNRQRRRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnInts

cCsn|jj}|jd|jd}|jt|t|dksZ|dkrj|jdndS(Nsselect returnfloat()ig&1	@gT㥛 	@swrong value(R>RMRNRQRRRRRF(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnFloats
cCs\|jj}|jd|jd}|jt|td|j|ddS(Nsselect returnnull()i(R>RMRNRQRRRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnNulls

cCso|jj}|jd|jd}tj1|jt|t|j|tdWdQXdS(Nsselect returnblob()iR(	R>RMRNRQRR	RRRR
(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnBlobs

cCs@|jj}|jd|jd}|j|ddS(Nsselect returnlonglong()iiiI(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncReturnLongLongs
cCsk|jj}y(|jd|j|jdWn-tjk
rf}|j|jddnXdS(Nsselect raiseexception()s#should have raised OperationalErroris&user-defined function raised exception(	R>RMRNRQRFR<RGRRtargs(RROte((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckFuncExceptions

cCsC|jj}|jdd|jd}|j|ddS(Nsselect isstring(?)Rii(R(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckParamStringscCsC|jj}|jdd|jd}|j|ddS(Nsselect isint(?)i*ii(i*(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt
CheckParamIntscCsC|jj}|jdd|jd}|j|ddS(Nsselect isfloat(?)gQ	@ii(gQ	@(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckParamFloatscCsC|jj}|jdd|jd}|j|ddS(Nsselect isnone(?)ii(N(R>RMRNRRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckParamNonescCs_|jj}tj|jdtdfWdQX|jd}|j|ddS(Nsselect isblob(?)Rii(R>RMRR	RNR
RQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckParamBlobs

cCsC|jj}|jdd|jd}|j|ddS(Nsselect islonglong(?)ii*iI(I(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckParamLongLongs(RR R@RBRHRPRSRTRURVRWRXRYR\R]R^R_R`RaRb(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR-}s$																		tAggregateTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZRS(cCstjd|_|jj}|jdtj*|jdddddtdfWdQX|jj	dd	t
|jj	d
d	t|jj	dd	t|jj	dd	t
|jj	d
d	t|jj	ddt|jj	dd	tdS(Ns:memory:s
            create table test(
                t text,
                i integer,
                f float,
                n,
                b blob
                )
            s6insert into test(t, i, f, n, b) values (?, ?, ?, ?, ?)RigQ	@Rtnostepit
nofinalizetexcInittexcSteptexcFinalizet	checkTypeitmysum(R<R=R>RMRNRR	RR
tcreate_aggregateRR!R$R%R&R'R,(RRO((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR@s
	"cCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRB scCsBy'|jjddt|jdWntjk
r=nXdS(NRCis&should have raised an OperationalError(R>R?R,RFR<RG(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrErrorOnCreate%s
cCs^|jj}y|jd|jdWn*tk
rY}|j|jddnXdS(Nsselect nostep(t) from tests$should have raised an AttributeErroris+AggrNoStep instance has no attribute 'step'(R>RMRNRFtAttributeErrorRRRZ(RROR[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrNoStep,s
cCsq|jj}y.|jd|jd}|jdWn-tjk
rl}|j|jddnXdS(Nsselect nofinalize(t) from testis&should have raised an OperationalErrors7user-defined aggregate's 'finalize' method raised error(	R>RMRNRQRFR<RGRRRZ(RROR(R[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrNoFinalize4s
cCsq|jj}y.|jd|jd}|jdWn-tjk
rl}|j|jddnXdS(Nsselect excInit(t) from testis&should have raised an OperationalErrors7user-defined aggregate's '__init__' method raised error(	R>RMRNRQRFR<RGRRRZ(RROR(R[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrExceptionInInit=s
cCsq|jj}y.|jd|jd}|jdWn-tjk
rl}|j|jddnXdS(Nsselect excStep(t) from testis&should have raised an OperationalErrors3user-defined aggregate's 'step' method raised error(	R>RMRNRQRFR<RGRRRZ(RROR(R[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrExceptionInStepFs
cCsq|jj}y.|jd|jd}|jdWn-tjk
rl}|j|jddnXdS(Nsselect excFinalize(t) from testis&should have raised an OperationalErrors7user-defined aggregate's 'finalize' method raised error(	R>RMRNRQRFR<RGRRRZ(RROR(R[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrExceptionInFinalizeOs
cCsC|jj}|jdd|jd}|j|ddS(Nsselect checkType('str', ?)Rii(R(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckParamStrXscCsC|jj}|jdd|jd}|j|ddS(Nsselect checkType('int', ?)i*ii(i*(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckParamInt^scCsC|jj}|jdd|jd}|j|ddS(Nsselect checkType('float', ?)gQ	@ii(gQ	@(R>RMRNRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckParamFloatdscCsC|jj}|jdd|jd}|j|ddS(Nsselect checkType('None', ?)ii(N(R>RMRNRRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckParamNonejscCs_|jj}tj|jdtdfWdQX|jd}|j|ddS(Nsselect checkType('blob', ?)Rii(R>RMRR	RNR
RQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckParamBlobps

cCsf|jj}|jd|jdd	d
dg|jd|jd}|j|ddS(Nsdelete from testsinsert into test(i) values (?)i
iisselect mysum(i) from testii<(i
(i(i(R>RMRNtexecutemanyRQRR(RROR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytCheckAggrCheckAggrSumws

(RR R@RBRlRnRoRpRqRrRsRtRuRvRwRy(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRcs																	tAuthorizerTestscBs;eZedZdZdZdZdZRS(cCs<|tjkrtjS|dks.|dkr5tjStjS(Ntc2tt2(R<t
SQLITE_SELECTtSQLITE_DENYt	SQLITE_OK(tactiontarg1targ2tdbnametsource((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt
authorizer_cbs
cCsItjd|_|jjd|jjd|jj|jdS(Ns:memory:s
            create table t1 (c1, c2);
            create table t2 (c1, c2);
            insert into t1 (c1, c2) values (1, 2);
            insert into t2 (c1, c2) values (4, 5);
            sselect c2 from t2(R<R=R>t
executescriptRNtset_authorizerR(R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyR@s
	cCsdS(N((R((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRBscCspy|jjdWnHtjk
r^}|jdjdsZ|jd|jdndSX|jddS(Nsselect * from t2it
prohibitedswrong exception text: %ss9should have raised an exception due to missing privileges(R>RNR<t
DatabaseErrorRZtendswithRF(RR[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyttest_table_accessscCspy|jjdWnHtjk
r^}|jdjdsZ|jd|jdndSX|jddS(Nsselect c2 from t1iRswrong exception text: %ss9should have raised an exception due to missing privileges(R>RNR<RRZRRF(RR[((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyttest_column_accesss(RR tstaticmethodRR@RBRR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRzs
				tAuthorizerRaiseExceptionTestscBseZedZRS(cCs@|tjkrtn|dks0|dkr9tntjS(NR{R|(R<R}t
ValueErrorR(RRRRR((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRs
		(RR RR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRstAuthorizerIllegalTypeTestscBseZedZRS(cCs6|tjkrdS|dks+|dkr/dStjS(NgR{R|(R<R}R(RRRRR((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRs
(RR RR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRstAuthorizerLargeIntegerTestscBseZedZRS(cCs6|tjkrdS|dks+|dkr/dStjS(Nii R{R|II(R<R}R(RRRRR((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRs
(RR RR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyRscCsmtjtd}tjtd}tjt}tj|||tjttjttjtfS(NtCheck(	tunittestt	makeSuiteR-RcRzt	TestSuiteRRR(tfunction_suitetaggregate_suitetauthorizer_suite((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pytsuitescCs tj}|jtdS(N(RtTextTestRunnertrunR(trunner((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyttestst__main__((((((((#Rtsqlite3R<RRRRRRRRRR
RRRRRRRR!R$R%R&R'R,tTestCaseR-RcRzRRRRR(((s6/usr/local/lib/python2.7/sqlite3/test/userfunctions.pyt<module>sB														



x,		
	
	

Zerion Mini Shell 1.0