ACC SHELL

Path : /usr/lib/python/sqlite3/test/
File Upload :
Current File : //usr/lib/python/sqlite3/test/hooks.pyc

Ñò
p&ÄMc@s„ddkZddkZddkZdeifd„ƒYZdeifd„ƒYZd„Zd„Ze	djoeƒndS(	iÿÿÿÿNtCollationTestscBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsdS(N((tself((s(/usr/lib/python2.6/sqlite3/test/hooks.pytsetUpscCsdS(N((R((s(/usr/lib/python2.6/sqlite3/test/hooks.pyttearDownscCsctidƒ}y!|iddƒ|idƒWn,tj
o }|i|iddƒnXdS(Ns:memory:tXi*sshould have raised a TypeErrorisparameter must be callable(tsqlitetconnecttcreate_collationtfailt	TypeErrortfailUnlessEqualtargs(Rtconte((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckCreateCollationNotCallable"scCsOtidƒ}y!|idtƒ|idƒWntij
o	}nXdS(Ns:memory:scolläs%should have raised a ProgrammingError(RRRtcmpRtProgrammingError(RRR
((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckCreateCollationNotAscii*scCstidjodSd„}tidƒ}|id|ƒd}|i|ƒiƒ}|ddd	jp*|ddd
jp|dddjo|idƒn|iddƒy&|i|ƒiƒ}|id
ƒWn5tij
o&}|i	|i
diƒdƒnXdS(NiiicSst||ƒS(N(R(txty((s(/usr/lib/python2.6/sqlite3/test/hooks.pytmycoll5ss:memory:RsÉ
            select x from (
            select 'a' as x
            union
            select 'b' as x
            union
            select 'c' as x
            ) order by x collate mycoll
            itctbtas#the expected order was not returneds&should have raised an OperationalErrors"no such collation sequence: mycoll(iii(Rtversion_infoRRtexecutetfetchallRtNonetOperationalErrorR
Rtlower(RRRtsqltresultR
((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckCollationIsUsed2s		?cCs†tidƒ}|idtƒ|idd„ƒ|idƒiƒ}|dddjp|dddjo|id	ƒnd
S(s„
        Register two different collation functions under the same name.
        Verify that the last one is actually used.
        s:memory:RcSst||ƒS((R(RR((s(/usr/lib/python2.6/sqlite3/test/hooks.pyt<lambda>Vssi
            select x from (select 'a' as x union select 'b' as x) order by x collate mycoll
            iRiRs wrong collation function is usedN(RRRRRRR(RRR((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckCollationRegisterTwiceOs*cCs”tidƒ}|idtƒ|iddƒy|idƒ|idƒWn@tij
o1}|idi	dƒp|idƒqnXdS(	su
        Register a collation, then deregister it. Make sure an error is raised if we try
        to use it.
        s:memory:Rs?select 'a' as x union select 'b' as x order by x collate mycolls&should have raised an OperationalErrorisno such collation sequenceswrong OperationalError raisedN(
RRRRRRRRRt
startswith(RRR
((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckDeregisterCollation]s
(	t__name__t
__module__RRRRR R"R$(((s(/usr/lib/python2.6/sqlite3/test/hooks.pyRs						t
ProgressTestscBs,eZd„Zd„Zd„Zd„ZRS(csRtidƒ}g‰‡fd†}|i|dƒ|idƒ|iˆƒdS(sK
        Test that the progress handler is invoked once it is set.
        s:memory:csˆidƒdS(Ni(tappendR((tprogress_calls(s(/usr/lib/python2.6/sqlite3/test/hooks.pytprogressss
is0
            create table foo(a, b)
            N(RRtset_progress_handlerRt
failUnless(RRR*((R)s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckProgressHandlerUsedmscsŸtidƒ}g‰‡fd†}|i|dƒ|iƒ}|idƒtˆƒ}g‰|i|dƒ|idƒtˆƒ}|i||jƒdS(s=
        Test that the opcode argument is respected.
        s:memory:csˆidƒdS(Ni(R(R((R)(s(/usr/lib/python2.6/sqlite3/test/hooks.pyR*ƒs
is1
            create table foo (a, b)
            is1
            create table bar (a, b)
            N(RRR+tcursorRtlenR,(RRR*tcurstfirst_counttsecond_count((R)s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckOpcodeCount}scs]tidƒ}g‰‡fd†}|i|dƒ|iƒ}|iti|idƒdS(sW
        Test that returning a non-zero value stops the operation in progress.
        s:memory:csˆidƒdS(Ni(R(R((R)(s(/usr/lib/python2.6/sqlite3/test/hooks.pyR*šs
iscreate table bar (a, b)N(RRR+R.tassertRaisesRR(RRR*R0((R)s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckCancelOperation”scCshtidƒ}d}d„}|i|dƒ|iddƒ|idƒiƒ|i|ddƒdS(sc
        Test that setting the progress handler to None clears the previously set handler.
        s:memory:icSs
d}dS(Nii((taction((s(/usr/lib/python2.6/sqlite3/test/hooks.pyR*ªsis&select 1 union select 2 union select 3s progress handler was not clearedN(RRR+RRRR
(RRR6R*((s(/usr/lib/python2.6/sqlite3/test/hooks.pytCheckClearHandler¤s	(R%R&R-R3R5R7(((s(/usr/lib/python2.6/sqlite3/test/hooks.pyR'ls			cCs7titdƒ}titdƒ}ti||fƒS(NtCheck(tunittestt	makeSuiteRR't	TestSuite(tcollation_suitetprogress_suite((s(/usr/lib/python2.6/sqlite3/test/hooks.pytsuite²scCs tiƒ}|itƒƒdS(N(R9tTextTestRunnertrunR>(trunner((s(/usr/lib/python2.6/sqlite3/test/hooks.pyttest·st__main__(
tosR9tsqlite3RtTestCaseRR'R>RBR%(((s(/usr/lib/python2.6/sqlite3/test/hooks.pyt<module>sQF		


ACC SHELL 2018