ķ oŽ¸Qc@€sŒddlmZddlZddlZeadejfd„ƒYZdej fd„ƒYZ d„Z d„Z e d krˆe ƒndS( i˙˙˙˙(twith_statementNt MyConnectioncB€seZd„ZRS(cC€statjj|ƒdS(N(tTruet did_rollbacktsqlitet Connectiontrollback(tself((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyRs(t__name__t __module__R(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyRst ContextTestscB€s5eZd„Zd„Zd„Zd„Zd„ZRS(cC€s2tjddtƒ|_|jjdƒtadS(Ns:memory:tfactoryscreate table test(c unique)(RtconnectRtcontexecutetFalseR(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytsetUp%scC€s|jjƒdS(N(R tclose(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyttearDown+scC€s|jWdQXdS(s7Can the connection be used as a context manager at all?N(R (R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManager.s cC€s]|j|jjdƒWdQX|jjƒ|jjdƒjƒd}|j|dƒdS(s*Is a commit called in the context manager?s"insert into test(c) values ('foo')Nsselect count(*) from testii(R RRtfetchonet assertEqual(Rtcount((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManagerCommit3s   cC€so|jttƒy4|j%|jjdƒ|jjdƒWdQXWntjk rZnX|jttƒdS(s,Is a rollback called in the context manager?sinsert into test(c) values (4)N(RRRR RRtIntegrityErrorR(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManagerRollback;s (RR RRRRR(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyR $s     cC€s"tjtdƒ}tj|fƒS(NtCheck(tunittestt makeSuiteR t TestSuite(t ctx_suite((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytsuiteGscC€s tjƒ}|jtƒƒdS(N(RtTextTestRunnertrunR(trunner((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyttestKs t__main__(t __future__RRtsqlite3RRRRRtTestCaseR RR#R(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyts  #