%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/bsddb/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/bsddb/test/test_early_close.pyc

ó
Oêáac@sÔdZddlZddlZddlZddlmZmZmZmZm	Z	yddl
Z
Wnek
runXe
jdddde
ƒdejfd	„ƒYZd
„ZedkrÐejdd
ƒndS(sfTestCases for checking that it does not segfault when a DBEnv object
is closed before its DB objects.
iÿÿÿÿN(tdbttest_supporttverbosetget_new_environment_pathtget_new_database_pathtignoretmessagesDB could not be closed intcategorytDBEnvClosedEarlyCrashcBsYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	cCstƒ|_d|_dS(Nttest(RthomeDirtfilename(tself((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pytsetUpscCstj|jƒdS(N(RtrmtreeR
(R((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyttearDownscCstjƒ}|j|jtjtjBtjBtjBdƒtj|ƒ}tj|ƒ}|j|j	tj
tjtjBdƒ|jtj|j|j	dtj
tjdƒ|j
ddƒ|j|jdƒddƒ|jƒ|jtj|jdƒdS(Ni¶t2R	sthis is a testsput!=get(RtDBEnvtopenR
tDB_INIT_CDBt	DB_CREATEt	DB_THREADt
DB_INIT_MPOOLtDBRtDB_BTREEtassertRaisestDBNoSuchFileErrortputtassertEqualtgettclosetDBError(Rtdbenvtdtd2((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyttest01_close_dbenv_before_db s&
cCsttjƒ}|j|jtjtjBtjBtjBdƒtj|ƒ}|j|j	tj
tjtjBdƒ|jddƒ|jddƒ|jddƒ|j|j
dƒddƒ|jƒ}|jƒ|jƒ|jƒ|jtj|jƒtj|ƒ}|j|j	tj
tjtjBdƒ|jƒ}|jƒ|jƒ|jƒ|jtj|jƒdS(	Ni¶R	sthis is a testttest2sanother testttest3sanother onesput!=get(RRRR
RRRRRRRRRRtcursortfirsttnextRRR(RR R!tc((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt"test02_close_dbenv_before_dbcursor2s,&


&


cCsæddl}|jj|j|jƒ}tjƒ}|j|tjtj	tj
Bdƒ|jddƒ|jddƒ|jddƒ|j|j
dƒdd	ƒ|jƒ}|jƒ|jƒ|jƒ|jtj|jƒdS(
Niÿÿÿÿi¶R	sthis is a testR$sanother testR%sanother onesput!=get(tos.pathtpathtjoinR
RRRRRRRRRRR&R'R(RRR(RtosR,R!R)((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt+test03_close_db_before_dbcursor_without_envOs#


cCstjƒ}|j|jtjtjBtjBtjBdƒgtdƒD]}tj	|ƒ^qG}g}x4|D],}|j|j
tjtjtjBdƒqoW|djddƒ|djddƒ|djdd	ƒ|j
|d
jdƒddƒx:|D]2}|jgtdƒD]}|jƒ^qƒqWx%|ddd
…D]}|jƒqLWx%|ddd
…D]}|jƒqtW|jtj|djdƒ|jtj|djƒ|djƒ|djƒ|jƒ|jtj|djƒdS(Ni¶ii
R	sthis is a testR$sanother testR%sanother oneisput!=geti ii	ieiP(RRRR
RRRRtxrangeRRRRRRtextendR&RRRR'R((RR titdbstcursorstj((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyttest04_close_massive`s0(
* 
0
cCs½tjƒ}|j|jtjtjBtjBtjBdƒtj|ƒ}|j|j	tj
tjtjBdƒ|jƒ~yddl}Wnt
k
r¥d}nX|r¹|jƒndS(Ni¶iÿÿÿÿ(RRRR
RRRRRRRRtgctImportErrortNonetcollect(RR R!R7((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt$test05_close_dbenv_delete_db_success„s&


cCsotjƒ}|j|jtjtjBtjBtjBƒtj|ƒ}|j	ƒ}|j|j
dtjdtjd|ƒ|jddd|ƒ|j
ƒ|j	ƒ}|j|ƒ}|jƒ}|jd
|jƒƒddl}tjdkr|jd	ƒ|j
ƒ|jƒn?|jƒ}|jƒz|jd	ƒ|j
ƒWd|jƒX|jtj|jƒdS(NtdbtypetflagsttxntXXXtyyyiÿÿÿÿiiR(R?R@(ii(RRRR
tDB_INIT_TXNRtDB_INIT_LOGRRt	txn_beginRtDB_HASHRtcommitR&tdupRR'twarningstsystversion_infotsimplefiltert
resetwarningstcatch_warningst	__enter__t__exit__RtDBCursorClosedError(RR R!R>tc1tc2RGtw((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt"test06_close_txn_before_dup_cursor˜s2!





cCs}ddl}|jj|j|jƒ}tjƒ}|j|tjtj	tj
Bdƒtj|ƒ}|jƒ|jƒdS(Niÿÿÿÿi¶(
R+R,R-R
RRRRRRRt
DBSequenceR(RR.R,R!R3((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyttest07_close_db_before_sequenceÅs#
(t__name__t
__module__R
RR#R*R/R6R;RSRU(((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyRs						$		-cCs&tjƒ}|jtjtƒƒ|S(N(tunittestt	TestSuitetaddTestt	makeSuiteR(tsuite((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt
test_suiteÐst__main__tdefaultTestR](t__doc__R.RHRXttest_allRRRRRRGR8tfilterwarningstRuntimeWarningtTestCaseRR]RVtmain(((s7/usr/local/lib/python2.7/bsddb/test/test_early_close.pyt<module>s(
¸	

Zerion Mini Shell 1.0