Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/bsddb/test/test_basics.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@sdZddlZddlZddlZddlmZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
dZdejfd��YZdejfd	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZd$efd%��YZd&efd'��YZ d(efd)��YZ!d*efd+��YZ"d,efd-��YZ#d.e#fd/��YZ$d0e#fd1��YZ%d2ejfd3��YZ&d4e&fd5��YZ'd6e&fd7��YZ(d8ejfd9��YZ)d:�Z*e+d;kr�j,d<d=�ndS(>s_
Basic TestCases for BTree and hash DBs, with and without a DBEnv, with
various DB flags, etc.
i�N(tpprint(tdbttest_supporttverbosetget_new_environment_pathtget_new_database_patht-tVersionTestCasecBseZd�ZRS(cCsetj�}tr?dGddGHd|fGHtjGHddGHn|j|tjtjtjf�dS(Ns
s-=isbsddb.db.version(): %s(RtversionRtDB_VERSION_STRINGtassertEqualtDB_VERSION_MAJORtDB_VERSION_MINORtDB_VERSION_PATCH(tselftinfo((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest00_versions
(t__name__t
__module__R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyRst
BasicTestCasecBs:eZejZdddfZdZdZdZdZ
dZdZdZ
dZd�Zd�Zdd�Zd�Zd	�Zd
�Zd�Zddd�Zd
�Zd�Zd�Zej�dkr�d�Znd�Zd�Zd�Zd�Zej�dkrd�Z nej�dkr8d�Z!nRS(iiii�i�c	CsE|jr�t�|_y�tj�|_|jjd�|jjd�tt	j	��|_
|jj|j
�|jj|j
d�|jj|j|jtjB�d|_Wq�tj|j��q�nd|_t�|_tj|j�|_|js�|jj|j�|jj�}|j|d|jd�|j|d|jd�|jdtd|d|jd��n|jj|j�|jr�|jj|j|j|j|jtjB|j �n5|jj|jd	|j d
|jd|jtjB�|js7|j!tj"|jj|j�n|j#�dS(
Niiittestiii}gY@tmodetdbtypetflagsi($tuseEnvRthomeDirRtDBEnvtenvt
set_lg_maxt
set_tx_maxtintttimet_ttset_tx_timestampt	set_flagstenvsetflagstopentenvflagst	DB_CREATEtfilenameRtrmtreetNoneRtDBtdt
set_cachesizet	cachesizet
get_cachesizeR
t
dbsetflagstdbnameRtdbopenflagstdbmodetassertRaisestDBInvalidArgErrort
populateDB(RR-((s,/sys/lib/python2.7/bsddb/test/test_basics.pytsetUp0sF	 

		,				cCsP|jj�|jdk	r<|jj�tj|j�ntj|j	�dS(N(
R+tcloseRR)RR(RtostremoveR'(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttearDown_s


cCs�|j}xNt|jd�D]9}d|j|}|j|�}|j|||�qW|jdd|�xKt|jdd�D]2}d|}|j|�}|j|||�q�W|r�|j�nt|�}tr�|GHndS(Nis%04dsempty valuetiscreated %d records(R+tranget_numKeystmakeDatatputtcommittlenR(Rt_txnR+txtkeytdatatnum((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR5is	

cCstj|gd�S(Ni(tDASHtjoin(RRD((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR>�scCs|j}tr.dGddGHd|jjGHnx:ddddd	gD]#}|j|�}trD|GHqDqDW|j|jd
�d�|j|jd�d�y|jd�Wngtj	k
r}t
jdkr�j|dtj�n|j|j
dtj�tr%|GHq%nX|jd�|jdd�|j|jd�d�|jdd�|jtj@r�|j|jd�d�n|j|jd�d�y|jdddtj�Wngtjk
r)}t
jdkr�j|dtj�n|j|j
dtj�tr7|GHq7nX|jd�|jtj@rc|j|jd�d�n|j|jd�d�|j�|j�~tj|j�|_|jr�|jj|j|j�n|jj|j�|j}|j|jd
�d�|jtj@r.|j|jd�d�n|j|jd�d�|jdd�}trg|GHn|j|jdd�d�|jdd�}|j|d�|jd|�}|j||�|j�}|jt|�ti��trdGHt|�ndS(Ns
s-=is Running %s.test01_GetsAndPuts...t0001t0100t0400t0700t0999t0321s0321-0321-0321-0321-0321tabcdiiisexpected exceptionsa new recordssame keysthis should failRt0555s0555-0555-0555-0555-0555sbad datasbad keys"d.stat() returned this dictionary:(ii(ii( R+Rt	__class__RtgetR
R)tdeleteRtDBNotFoundErrortsystversion_infotDB_NOTFOUNDtargstfailR?R/tDB_DUPtDB_NOOVERWRITEtDBKeyExistErrortDB_KEYEXISTtsyncR7R*RR0R$R'tget_bothtstatttypeR(RR+RDREtvaltrects((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest01_GetsAndPuts�s|	




		cCs�|j}tr.dGddGHd|jjGHnxNddddd	gD]7}||}|j||j|��trD|GHqDqDW|jt|�|j�|j�}|jt|�|j�|jt	|�t	g��d
|d<|jt|�|jd�|j�}|jt|�|jd�d
|d<|jt|�|jd�|j�}|jt|�|jd�tr�dGHt
|d �n|j|dd
�|j|jdd�d�|j|jddd�d�|j
�}|jt|�|jd�|jt	|�t	g��|jt	|d�t	d��|jt|d�d�trdGHt
|d �n|j�}|jt|�|jd�|jt	|�t	g��tr�GHt
|d �ndS(Ns
s-=is&Running %s.test02_DictionaryMethods...t0002t0101t0401t0701t0998sa new records
new recordisa replacement recordsthe first 10 keys are:i
RItspamttxniisthe first 10 items are:sthe first 10 values are:((R+RRQRR
R>RAR=tkeysRaRthas_keyR)titemstvalues(RR+RDRERmRoRp((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest02_DictionaryMethods�sT	



 cCs�|j}xNdddddgD]7}||}|j||j|��tr|GHqqW|jt|d��|jd|k�|jd|k�dS(NRfRgRhRiRjt__contains__t1234(R+R
R>Rt
assertTruethasattrtassertFalse(RR+RDRE((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest02b_SequenceMethods&s	
c	Cs�tr.dGddGHd|jj||fGHn|jrY|jtj@rY|jj�}nd}|j	j
d|�}|j�}d}x|dk	r�|d}tr�|ddkr�|GHny|j�}Wn�tj
k
rR}|rBtjd1kr|j|dtj�n|j|jdtj�tr9|GHnd}qS|jd�nX|j|j�t|j�d�d|j�|j�df�q�W|j||j�|j�}d}x�|dk	r�|d}tr�ddkr�GHny|j�}Wq�tj
k
r�}|r{tjd2krJ|j|dtj�n|j|jdtj�trr|GHnd}q�|jd�q�Xq�W|j||j�|jd
�}|j�}|j||�|j|dd
�|j|d|jd
��|j|j�t|d��|jd�}|j|dd�|j|j�d�y|jd�}	Wngtj
k
r�}tjd3kr�|j|dtj�n|j|jdtj�tr|GHqn:X|r�jd�n|	dk	r|jd|	f�n|jd|jd��}|j|d|jd�f�y|jdd�}	Wngtj
k
r�}tjd4kr�|j|dtj�n|j|jdtj�tr|GHqn:X|r�|jd�n|	dk	r|jd|	f�n|j	j�tjkr�|jd�}tr:dG|GHn|jddddd�}trgdG|GHn|ddkr�|jd�n|jd�}
tr�dG|
GHn|
ddkr�|jd�q�n|jd�|j �y|j�}Wn}tj!k
rq}|ratjd5kr6|j|dtj"�n|j|jdtj"�trn|GHqnq�|jd�nX|r�|jd�n|j�|j#tj$�}|j|j�|j��|j%dd tj&�|j|j�|j��|j|j�dd �|j%dd!tj&dddd"�|j|j�dd#�|j'�|j'�|ro|j(�ni
d6d$6d7d%6tj$fd&6d8d'6d9d(6d:d)6d;d*6d<d+6dd,tj&fd-6d=d.6}x�|j)�D]�\}
}y)tr�|
GHnt*||
�|�Wnatj+k
rr}tjd>krJ|j|dd�n|j|jdd�tr�|GHq�q�X|jd0|
�q�W|j	j
d|�}|j	j'�~dS(?Ns
s-=isCRunning %s.test03_SimpleCursorStuff (get_error %s, set_error %s)...Rliiidiisunexpected DBNotFoundErrors
%s != len(%r)t0505sempty valueR;sbad keysexpected exceptionsexpected None: %rt0404sbad datat011ssearched for '011', found: tdlentdoffs%searched (partial) for '011', found: sexpected empty data portions!search for 'empty value' returnedsempty value lookup failedt0499sunexpected DBKeyEmptyErrors"DBKeyEmptyError exception expectedsa new valueteris
a newer valuetcurrentRStduptfirstRRtnexttprevtlastRkR?tsets-attempting to use a closed cursor's %s methods8no exception raised when using a buggy cursor's%s method(ii(ii(ii(ii(ii((((i((((Rx(ii(,RRQRRR1RtDB_AUTO_COMMITt	txn_beginR)R+tcursorR�R�RTRURVR
RWRXRYtget_current_sizeRARR=R�R�R�R>R_tget_typetDB_BTREEt	set_rangeRStDBKeyEmptyErrortDB_KEYEMPTYR�tDB_POSITIONR?t
DB_CURRENTR7R@RotgetattrtDBError(Rtget_raises_errortset_raises_errorRltcRctcountRbtrec2tntevtc2tmethods_to_testtmethodRXt	oldcursor((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest03_SimpleCursorStuff6s*

	"%
	 


"




		
cCsatr%dGddGHd|jjGHn|jjd�}|j|d�|jddd	d�dS(
Ns
s-=is<Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone...iiR�iR�(RRQRR+tset_get_returns_noneR
R�(Rtold((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt*test03b_SimpleCursorWithoutGetReturnsNone0�s
cCsQtr%dGddGHd|jjGHn|jjd�}|jdddd�dS(	Ns
s-=is<Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone...iR�iR�(RRQRR+R�R�(RR�((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt'test03b_SimpleCursorWithGetReturnsNone1�s
cCs�tr%dGddGHd|jjGHn|jjd�}|j|d�|jjd�}|j|d�|jddd	d�dS(
Ns
s-=is<Running %s.test03c_SimpleCursorStuffWithoutSetReturnsNone...iiR�iR�(RRQRR+R�R
R�(RR�((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt#test03c_SimpleCursorGetReturnsNone2	s
iicCsr|jj�}|jtj�|jtj|j��|jdtj�|jtj|j��|j�dS(Ntpriority(	R+R�tset_priorityRtDB_PRIORITY_VERY_LOWR
tget_prioritytDB_PRIORITY_HIGHR7(RR�((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest03d_SimpleCursorPriorityscCsX|j}tr.dGddGHd|jjGHnd}dddd}|j||�|j|j|�|�|j|j|d	d
dd�dd�|jdddd�|j|jdd	ddd�d�|jtj	krT|j|dd	ddd�|j|j|�d�|j|dd	ddd�|j|j|�d�ndS(Ns
s-=is%Running %s.test04_PartialGetAndPut...tpartialTestt1i�t2R{iR|i�i
tpartialtest2i0utrobinit0000i�it1111iit0011110t
1111111111t
2222222222(
R+RRQRR?R
RRR/RRZ(RR+RDRE((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest04_PartialGetAndPut!s$	
%cCs�|j}tr.dGddGHd|jjGHnxQtddd�D]=}d|}|j|d	|�|j|j|�|�qAWdS(
Ns
s-=isRunning %s.test05_GetSize...iiP�i�ssize%sR�(R+RRQRR<R?R
tget_size(RR+tiRD((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest05_GetSize@s	

cCs�|j}tr.dGddGHd|jjGHn|jdd�|j�}|j|dkd�|j�}|j|d	d
|f�dS(Ns
s-=isRunning %s.test06_Truncate...tabcdetABCDEis,truncate returned <= 0 on non-empty databaseis*truncate on empty DB returned nonzero (%r)(R+RRQRR?ttruncateRtR
(RR+RF((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest06_TruncatePs	
cCs3|jj�tj|j�}|j|j�dS(N(R+R7RR*RtverifyR'(RR+((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt
test07_verify_s
cCs[|jjdd�|j|jjd�tkd�|j|jjd�tkd�dS(NR�R�s DB->exists() returns wrong valueRC(R+R?RttexiststTruetFalse(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt
test08_existsis
icCs�|j}|jd|jdtj��|jd|jdtj��|jdd�|jdd�|jdd�|jd	d
�|jd�|jd�|jdddd	d
ddddddddtjtjB�dS(NiRR�R�tbcdetBCDEtabctABCtmontytpythontstarttstopRltcompact_fillpercenti*t
compact_pagesitcompact_timeouti��R+R
tcompactRtDB_FREELIST_ONLYR?RSR)t
DB_FREE_SPACE(RR+((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest_compactss	

iN(ii(ii(ii("RRRt
DB_UNKNOWNRR-R1R/R2R)R0RR%R#R=R6R:R5R>ReRqRwR�R�R�R�RR�R�R�R�R�R�R�(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR#s>		/	
		b	=	�		

						tBasicBTreeTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��stBasicHashTestCasecBseZejZRS((RRRtDB_HASHR(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��st BasicBTreeWithThreadFlagTestCasecBseZejZejZRS((RRRR�Rt	DB_THREADR1(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��s	tBasicHashWithThreadFlagTestCasecBseZejZejZRS((RRRR�RR�R1(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��s	tBasicWithEnvTestCasecBs7eZejZdZejejBejBZd�Z	RS(icCsy|js
dStr2dGddGHd|jjGHn|jj�|jd}|jj|jd|�|jj	|�dS(Ns
s-=is'Running %s.test09_EnvRemoveAndRename...s.renamed(
RRRQRR+R7R'tdbrenameR)tdbremove(Rtnewname((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest09_EnvRemoveAndRename�s	


(
RRRR�R1Rt
DB_INIT_MPOOLtDB_INIT_LOCKR%R�(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��s	tBasicBTreeWithEnvTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��stBasicHashWithEnvTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��stBasicTransactionTestCasecBseZejdks3ejdkrBejdkrBdd�ZnejejBZ	dZ
ejejBejBej
BZejZd�Zd�Zd�Zej�dkr�d�Znd�Zd
�Zej�dkrd�Zd�Zd�Zd�ZnRS(iiiicCs|j||kd|�S(Ntmsg(Rt(RtatbR�((s,/sys/lib/python2.7/bsddb/test/test_basics.pytassertIn�sicCs|jj�tj|�dS(N(RlR@RR:(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR:�s
cCs8|jj�}tj|d|�|jj�|_dS(NRB(RR�RR5Rl(RRl((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR5�scCs�|j}tr.dGddGHd|jjGHn|j|jdd|j�d�|jdd|j�|j|jdd|j�d�|jj	�|j|jd�d�|j
j�|_|j|jdd|j�d�|jdd|j�|j|jdd|j�d�|jj�|j|jd�d�|j
j�|_|j
|j�}|j�}d}xD|dk	r�|d	}tr�|d
dkr�|GHn|j�}qyW|j||jd	�|j�|jj�|j
jddd�|j
jd�}|jd|�|jd|�|jd
|�|jd|�|j
jtjtjB�}|j|d�xC|D];}tr�d|GHn|j
jtj�}|j|�q�W|j
j�|_dS(Ns
s-=is!Running %s.test06_Transactions...snew recRlsthis is a new recordiiidtmagicRtcur_filet
region_nowaits
log file: (R+RRQRR
RRRlR)R?tabortRR�R@R�R�R�R=R7ttxn_checkpointtlog_statR�tlog_archiveRtDB_ARCH_ABStDB_ARCH_LOGtassertNotEqualtDB_ARCH_REMOVERt(RR+R�RcR�tstatDicttlogstlog((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest06_Transactions�sV	
"
"




iicCs�|jj�}|jjddd|�|j�|jj�}|j|jjdd|�tkd�|j|jjdd|�tkd�|j	�dS(NR�R�Rls DB->exists() returns wrong valueRC(
RR�R+R?R@RtR�R�R�R�(RRl((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�s
!!cCs�|j}tr.dGddGHd|jjGHn|jdd�|jj�}|j|�}|j|dkd�|j|�}|j	|d	d
|f�|j
�dS(Ns
s-=is Running %s.test09_TxnTruncate...R�R�is,truncate returned <= 0 on non-empty databaseis*truncate on empty DB returned nonzero (%r)(R+RRQRR?RR�R�RtR
R@(RR+RlRF((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest09_TxnTruncates	
cCs�|jj�}|j�y|j�Wntjk
r?}n
Xtd�|jj�}|j�y|j�Wntjk
r�}n
Xtd�dS(NsBDBTxn.abort() called after DB_TXN no longer valid w/o an exceptionsCDBTxn.commit() called after DB_TXN no longer valid w/o an exception(RR�R�RR�tRuntimeErrorR@(RRlte((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest10_TxnLateUse-s
	
cCsy|jj�}|j|j�d�|jd�|j|j�d�|jd�|j|j�d�|j�dS(NR;tXXYY(RR�R
tget_nametset_nameR�(RRl((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt
test_txn_nameEs

cCsF|jj�}|jdtj�|jddtj�|j�dS(Ni�i�#R(RR�tset_timeoutRtDB_SET_LOCK_TIMEOUTtDB_SET_TXN_TIMEOUTR�(RRl((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest_txn_set_timeoutQscCs|j|jj�d�dS(Ni(R
Rt
get_tx_max(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest_get_tx_maxYscCs |j|jj�|j�dS(N(R
Rtget_tx_timestampR (R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest_get_tx_timestamp\s(ii(ii(iiN(ii(ii(RRRURVR)R�RR�R�R1RR�R�tDB_INIT_TXNR%R#R:R5R�RR�R�R�R�RRR(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR��s(
				:
					tBTreeTransactionTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyRastHashTransactionTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyRdstBTreeRecnoTestCasecBs#eZejZejZd�ZRS(cCs|j}tr.dGddGHd|jjGHn|jd�}|jt|�td��|jt|�d�tr�dG|GHn|j�}|j	d�|j
�}|jt|�td	��tr�d
G|GHn|j�}|j|j|�|�|j
�dS(Ns
s-=is!Running %s.test09_RecnoInBTree...i�isRecord #200 is t0200isrecno of d['0200'] is ((R+RRQRRRR
RaRAR�R�t	get_recnoRt	set_recnoR7(RR+RcR�RF((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest09_RecnoInBTreeos$	

(RRRR�Rt	DB_RECNUMR/R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyRks		t BTreeRecnoWithThreadFlagTestCasecBseZejZRS((RRRR�R1(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�stBasicDUPTestCasecBseZejZd�ZRS(c	Cs�|j}tr.dGddGHd|jjGHn|jdd�x$dj�D]}|jd|�qKW|jd	d
�|jd�}|j|d�tr�|GHn|j�}|j	d�}|j|d�|j
�}|j|d�|j	d�}|j�}|j|d
�|j�}|j|d�|j	d�}x*|dk	rktr\|GHn|j�}qBW|j	d�|j�}|j|dd�tr�|GHn|j�dS(Ns
s-=is"Running %s.test10_DuplicateKeys...tdup0tbefores-The quick brown fox jumped over the lazy dog.tdup1tdup2taftertThetquicki	i(RR(RR(RR(R+RRQRR?tsplitRRR
R�R�R�R�tnext_dupR)t
next_nodupR�R7(	RR+RCRER�Rctnext_regR�R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest10_DuplicateKeys�sD	

(RRRRZR/R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�s	tBTreeDUPTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�stHashDUPTestCasecBseZejZRS((RRRR�R(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�stBTreeDUPWithThreadTestCasecBseZejZejZRS((RRRR�RR�R1(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�s	tHashDUPWithThreadTestCasecBseZejZejZRS((RRRR�RR�R1(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR�s	tBasicMultiDBTestCasecBs eZdZd�Zd�ZRS(R�cCs$|jtjkrtjStjSdS(N(RRR�R�(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt	otherType�sc
Cs_|j}tr.dGddGHd|jjGHntj|j�}|j|jd|j	|j
tjB�tj|j�}|j|jd|j�|j
tjB�x-dj
�D]}|j||j|��q�Wx%tjD]}|j||d�q�W|j�|j�|j�|j�|j�|j�d|_}}}tj|j�|_}|j|j|jd	|j
�tj|j�}|j|jdd	|j
�tj|j�}|j|jdd	|j
�|j�}|j�}|j�}d
}|j�}	xD|	dk	rZ|d}trK|dd
krK|	GHn|j�}	qW|j||j�d
}|j�}	x4|	dk	r�|d}tr�|	GHn|j�}	q�W|j|d
�d
}|j�}	x4|	dk	r|d}tr|	GHn|j�}	q�W|j|ttj��|j�|j�|j�|j�|j�dS(Ns
s-=isRunning %s.test11_MultiDB...tsecondtthirds,The quick brown fox jumped over the lazy dogiFRiii2i	(R+RRQRRR*RR$R'RR1R&R!RR?R>tstringtlettersR^R7R)R0R�R�R�R
R=RA(
Rtd1td2td3RCtc1R�tc3R�Rc((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest11_MultiDB�sv	













(RRR0R!R+(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR �s	tBTreeMultiDBTestCasecBs7eZejZejZdZejejBej	BZ
RS(i(RRRR�RR�R1RR�R�R%(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR,)s		tHashMultiDBTestCasecBs7eZejZejZdZejejBej	BZ
RS(i(RRRR�RR�R1RR�R�R%(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR-/s		t
PrivateObjectcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
|`dS(N(tobj(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR:7scCs|j|jj�d�dS(N(R
R/tget_privateR)(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest01_DefaultIsNone:scCs<d}|jj|�|jj�}|j||k�dS(Nsexample of private object(R/tset_privateR0Rt(RR�R�((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest02_assignment=scCsod}tj|�}|jj|�|j|dtj|��|jjd�|j|tj|��dS(Nsexample of private objecti(RUtgetrefcountR/R2R
R)(RR�trefcount((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest03_leak_assignmentCscCsKd}tj|�}|jj|�d|_|j|tj|��dS(Nsexample of private object(RUR4R/R2R)R
(RR�R5((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest04_leak_GCKs
	(RRR:R1R3R6R7(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR.6s
				tDBEnvPrivateObjectcBseZd�ZRS(cCstj�|_dS(N(RRR/(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR6Ss(RRR6(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR8RstDBPrivateObjectcBseZd�ZRS(cCstj�|_dS(N(RR*R/(R((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR6Ws(RRR6(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR9VstCrashAndBurncBs&eZej�dkr$d�ZnRS(iicCs7ddl}|jtjtjtj�|j�dS(Ni�(tgcR3RR4RtDB_RPCCLIENTtcollect(RR;((s,/sys/lib/python2.7/bsddb/test/test_basics.pyttest02_DBEnv_dealloc`s(ii(RRRRR>(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyR:ZscCs�tj�}|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt	��|jtjt
��|jtjt��|jtjt��|jtjt
��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|S(N(tunittestt	TestSuitetaddTestt	makeSuiteRR�R�R�R�R�R�RRRRRRRRR,R-R8R9R:(tsuite((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt
test_suitejs,t__main__tdefaultTestRD(-t__doc__R8terrnoR$RR?RRUttest_allRRRRRRGtTestCaseRRR�R�R�R�R�R�R�R�RRRRRRRRRR R,R-R.R8R9R:RDRtmain(((s,/sys/lib/python2.7/bsddb/test/test_basics.pyt<module>sP(
�f�2X	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.