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

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


��Qc@s�dZddlZddlZddlZyddlZWnek
rYddlZnXejddkr�dZde	fd��YZ
de	fd	��YZd
efd��YZde	fd
��YZ
de	fd��YZde	fd��YZddlZgedd�D]Zee�^qe_ejjej_ejjej_ejj�d3krvdej_nejjej_d�Ze e_!ee"�ny>ddlmZm#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)WnKek
r2ddlmZm#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)nXyddlm*Z*WnGek
r�ejddkr}ddl+m*Z*q�ddl+m,Z*nXyXejddkr�ddl-m.Z.m/Z/[.[/nddl-m.Z.m0Z0[.[0e"Z1Wnek
re Z1nXdZ2dej3kr1dZ2ej3j4d�ndej3krYdZ2ej3j4d�nd�Z5d�Z6d �Z7d!�Z8ddlZddl9Zej:j;ej<j=d"ej:j;ej>d#��d$�e6_?de6_@d%�ZAd&�ZBd'�ZCe1rddl-Z-e-jD�e6_E[-n%d(e	fd)��YZDeD�e6_E[Dd*ejFfd+��YZGejddkr�ddlHZHe2eH_2nddlZejId,IJd-dd.�ZJd/�ZKeLd0kr�e5�ejMd1d2�ndS(4sRun all test cases.
i�Niis	iso8859-1tlogcursor_py3kcBsVeZd�Zd�Zd�ZeZd�Zd�Zd�Zd�Z	d�Z
RS(cCs|j�|_dS(N(t
log_cursort
_logcursor(tselftenv((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__init__scCst|j|�S(N(tgetattrR(Rtv((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__getattr__scCsEt|jd��}|dk	rA|d|djt�f}n|S(Ntnextii(RRtNonetdecodetcharset(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__next__s cCs?|jj�}|dk	r;|d|djt�f}n|S(Nii(RtfirstR
RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR!s cCs?|jj�}|dk	r;|d|djt�f}n|S(Nii(RtlastR
RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR's cCs?|jj�}|dk	r;|d|djt�f}n|S(Nii(RtprevR
RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR-s cCs?|jj�}|dk	r;|d|djt�f}n|S(Nii(RtcurrentR
RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR3s cCsB|jj|�}|dk	r>|d|djt�f}n|S(Nii(RtsetR
RR(RtlsnR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR9s (t__name__t
__module__RRR
R	RRRRR(((s)/sys/lib/python2.7/bsddb/test/test_all.pyRs							tcursor_py3kcBs�eZd�Zd�Zd�Zd�ZeZd�Zd�Zd�Z	d�Z
ddd	�Zd
d�Zd�Z
d
�Zd
ddd�Zd
ddd�Zd�Zddd
d�Zd�Zd�Zd�ZRS(cOs|j||�|_dS(N(tcursort	_dbcursor(Rtdbtargstkwargs((s)/sys/lib/python2.7/bsddb/test/test_all.pyR@scCst|j|�S(N(RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyRCscCsP|dkrdS|\}}t|t�r=|jt�}n||jt�fS(N(R
t
isinstancetbytesRR(RRtkeytvalue((s)/sys/lib/python2.7/bsddb/test/test_all.pyt_fixFscCs"t|jd��}|j|�S(NR	(RRR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR
MscCs|jj�}|j|�S(N(RtpreviousR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR!SscCs|jj�}|j|�S(N(RRR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyRWscCs@t|t�r!t|t�}n|jj|�}|j|�S(N(RtstrRRRRR (RtkR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR[scCs|jj|�}|j|�S(N(Rt	set_recnoR (RtnumR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR$asi�cCsLt|t�r!t|t�}n|jj|d|d|�}|j|�S(Ntdlentdoff(RR"RRRt	set_rangeR (RR#R&R'R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR(esicCs|jj|�}t|�S(N(Rtduptdup_cursor_py3k(RtflagsR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR)kscCs|jj�}|j|�S(N(Rtnext_dupR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR,oscCs|jj�}|j|�S(N(Rt
next_nodupR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR-ssc	Csgt|t�r!t|t�}nt|t�rBt|t�}n|jj||d|d|d|�S(NR+R&R'(RR"RRRtput(RRtdataR+R&R'R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR.wscCs.|jjd|d|d|�}|j|�S(NR+R&R'(RRR (RR+R&R'R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRs!cCs|jj�}|j|�S(N(RRR (RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�sc
Cs?t|t�r6|dkr6|dkr6|}d}nt|t�rWt|t�}nt|t�r�|dkr�|}d}nt|t�r�t|t�}n|jjd|d|d|�}|dk	r;|\}}}t|t�r�jt�}nt|t�r |jt�}n|||jt�f}n|S(NiRR/R+(	RtintR
R"RRRtpgetR(RRR/R+Rtv1tv2tv3((s)/sys/lib/python2.7/bsddb/test/test_all.pyR1�s&'		!cCs1|jj�}|dk	r-|jt�}n|S(N(Rt	join_itemR
RR(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR5�scOs-t|�}|dkrT|\}}t|t�rEt|d�}n||f}no|dkr�|\}}}t|t�r�t|t�}nt|t�r�t|t�}n|||f}n|jj||�}|dk	r)|\}}t|t�r|jt�}n||jt�f}n|S(Nis	iso8859-1i(	tlenRR"RRRtgetR
R(RRRtlR#tftdR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR7�s(cCsdt|t�r!t|t�}nt|t�rBt|t�}n|jj||�}|j|�S(N(RR"RRRtget_bothR (RRRR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR;�sN(RRRRR R
R	R!RRR$R(R)R,R-R.RRR
R1R5R7R;(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR?s(													R*cBseZd�ZRS(cCs
||_dS(N(R(Rtdbcursor((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�s(RRR(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR*�stDB_py3kcBseZd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Z
d�Zd	�Zd
�Z
ddddd
�Zdd�Zd�Zd�Zdddddd�Zdd�Zddd�Zdd�Zd�Zd�Zddd�Zddd�Zd�ZRS(cOs�g}x6|D].}t|t�r.|j}n|j|�q
Wt|�}x9|j�D]+\}}t|t�rX|j||<qXqXWtjj||�|_dS(N(	Rt
DBEnv_py3kt_dbenvtappendttupletitemstbsddbt_dbtDB_orig(RRRtargs2tiR#R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�s
cCs7t|t�r!t|t�}nt|jd�|�S(Nthas_key(RR"RRRRD(RR#((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__contains__�scCsPt|t�r!t|t�}n|j|}|dk	rL|jt�}n|S(N(RR"RRRDR
R(RR#R((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__getitem__�s
cCsSt|t�r!t|t�}nt|t�rBt|t�}n||j|<dS(N(RR"RRRD(RR#R((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__setitem__�s
cCs/t|t�r!t|t�}n|j|=dS(N(RR"RRRD(RR#((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__delitem__�scCst|j|�S(N(RRD(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�scCs
t|j�S(N(R6RD(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyt__len__�scCs7t|t�r!t|t�}n|jj|d|�S(Nttxn(RR"RRRDRH(RR#RN((s)/sys/lib/python2.7/bsddb/test/test_all.pyRH�scCs1t|t�r!t|t�}n|jj|�S(N(RR"RRRDtset_re_delim(Rtc((s)/sys/lib/python2.7/bsddb/test/test_all.pyRO�scCs1t|t�r!t|t�}n|jj|�S(N(RR"RRRDt
set_re_pad(RRP((s)/sys/lib/python2.7/bsddb/test/test_all.pyRQscCs|jj�}|jt�S(N(RDt
get_re_sourceRR(Rtsource((s)/sys/lib/python2.7/bsddb/test/test_all.pyRRsii�cCsmt|t�r!t|t�}nt|t�rBt|t�}n|jj||d|d|d|d|�S(NR+RNR&R'(RR"RRRDR.(RRR/RNR+R&R'R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR.	s$cCs7t|t�r!t|t�}n|jj|d|�S(NRN(RR"RRRDR@(RRRN((s)/sys/lib/python2.7/bsddb/test/test_all.pyR@scCs1t|t�r!t|t�}n|jj|�S(N(RR"RRRDtget_size(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyRTscOs7t|t�r!t|t�}n|jj|||�S(N(RR"RRRDtexists(RRRR((s)/sys/lib/python2.7/bsddb/test/test_all.pyRUstMagicCookiecCs�t|t�r!t|t�}n|dkr`|jj|d|d|d|d|d|�}n*|jj|d|d|d|d|�}|dk	r�t|t�r�|jt�}n|S(NRVtdefaultRNR+R&R'(RR"RRRDR7R
R(RRRWRNR+R&R'R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR7 s!cCs�t|t�r!t|t�}n|jj|d|�}|dk	r�|\}}t|t�rr|jt�}n||jt�f}n|S(NRN(RR"RRRDR1R
R(RRRNRR2R3((s)/sys/lib/python2.7/bsddb/test/test_all.pyR1-scCs�t|t�r!t|t�}nt|t�rBt|t�}n|jj||d|d|�}|dk	r�|jt�}n|S(NRNR+(RR"RRRDR;R
R(RRRRNR+R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR;9s!cCs7t|t�r!t|t�}n|jj|d|�S(NRN(RR"RRRDtdelete(RRRN((s)/sys/lib/python2.7/bsddb/test/test_all.pyRXCscCs_|jj�}t|�rWt|dt�rWg|jj�D]}|jt�^q>S|SdS(Ni(RDtkeysR6RRRR(RR#RG((s)/sys/lib/python2.7/bsddb/test/test_all.pyRYHs)cCs}|jj�}t|�s|Sg}xQ|D]I\}}t|t�rY|jt�}n|j||jt�f�q,W|S(N(RDRBR6RRRRR@(RR/tdata2R#R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRBOs cCsAdtfd��Y}|jj|j||�jd|d|�S(Ntassociate_callbackcBseZd�Zd�ZRS(cSs
||_dS(N(t	_callback(Rtcallback((s)/sys/lib/python2.7/bsddb/test/test_all.pyR[scSs�t|t�r!|jt�}n|jt�}|j||�}|tjjkr�t|t�rut|t�}q�t|t	�r�g}x<|D]4}t|t�r�t|t�}n|j
|�q�W|}q�n|S(N(RR"RRR\RCRDt
DB_DONOTINDEXRtlistR@(RRR/tkey2RG((s)/sys/lib/python2.7/bsddb/test/test_all.pyR]^s
(RRRR](((s)/sys/lib/python2.7/bsddb/test/test_all.pyR[Zs	R+RN(tobjectRDt	associateR](RtsecondarydbR]R+RNR[((s)/sys/lib/python2.7/bsddb/test/test_all.pyRbYscCst|jd|d|�S(NRNR+(RRD(RRNR+((s)/sys/lib/python2.7/bsddb/test/test_all.pyRsscCs2g|D]}|j^q}t|jj|��S(N(RR*RDtjoin(Rtcursor_listRG((s)/sys/lib/python2.7/bsddb/test/test_all.pyRdvsN(RRRRIRJRKRLRRMR
RHRORQRRR.R@RTRUR7R1R;RXRYRBRbRRd(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR=�s0	
											

		
R>cBsAeZd�Zd�Zdd�Zd�Zd�Zd�ZRS(cOstjj||�|_dS(N(RCRDt
DBEnv_origR?(RRR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR{scCst|j|�S(N(RR?(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR~sicCs
t|j�S(N(RR?(RR+((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�scCs|jj�jt�S(N(R?t
get_lg_dirRR(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRg�scCs|jj�jt�S(N(R?tget_tmp_dirRR(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRh�scCstd�|jj�D��S(Ncss|]}|jt�VqdS(N(RR(t.0RG((s)/sys/lib/python2.7/bsddb/test/test_all.pys	<genexpr>�s(RAR?t
get_data_dirs(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRj�s(RRRRRRgRhRj(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR>zs				tDBSequence_py3kcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cOs+||_tjj|j||�|_dS(N(RDRCtDBSequence_origt_dbsequence(RRRR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�s	cCst|j|�S(N(RRm(RR((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�scOs|jjt|t�||�S(N(RmtopenRR(RRRR((s)/sys/lib/python2.7/bsddb/test/test_all.pyRn�scCs|jj�jt�S(N(Rmtget_keyRR(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyRo�scCs|jS(N(RD(R((s)/sys/lib/python2.7/bsddb/test/test_all.pytget_dbp�s(RRRRRnRoRp(((s)/sys/lib/python2.7/bsddb/test/test_all.pyRk�s
				iAi[icCs�tj}|t_|ratt_tj_tj_tt_tj_tj_t	tj_
nXtjjt_tj_tj_tjjt_tj_tj_tjj
tj_
|S(N(tdo_proxy_db_py3ktflagR>RCtDBEnvRRDR=tDBRkt
DBSequenceRfRERl(Rrtflag2((s)/sys/lib/python2.7/bsddb/test/test_all.pyRq�s		##(Rtdbtablestdbutilstdbshelvethashopentbtopentrnopentdbobj(ttest_support(tsupport(tThreadt
currentThread(R�tcurrent_threadtverboseitsilentcCs�HddGHtjGHdtj�fGHtj�dkrNdttj��GHndtjGHdtjGHd	}d
ttd|�GHdttd|�GHd
t	jGHdt
j�GHddGHdS(Ns-=i&sbsddb.db.version():   %siisbsddb.db.full_version(): %ssbsddb.db.__version__: %ssbsddb.db.cvsid:       %st__spy module:            %st__filesextension module:     %sspython version:       %ssMy pid:               %s(ii(RtDB_VERSION_STRINGtversiontreprtfull_versiont__version__tcvsidRRCtsystostgetpid(tsuffix((s)/sys/lib/python2.7/bsddb/test/test_all.pytprint_versions�s	cCs~tjj�z\ddl}|jjtj|dt|j��dttj	��}tj	d7_	Wdtjj
�X|S(Ni�t_i(tget_new_pathtmutextacquireR�tpathRdtprefixR"R�R%trelease(tnameR�R�((s)/sys/lib/python2.7/bsddb/test/test_all.pyR��s
.cCsdtd�}ddl}y|j|dd�Wn.|jk
r_tj|�|j|�nX|S(Ntenvironmenti�tmodei�(R�R�tmakedirsterrorR~trmtree(R�R�((s)/sys/lib/python2.7/bsddb/test/test_all.pytget_new_environment_path�s
cCs>td�}ddl}|jj|�r:|j|�n|S(Ntdatabasei�(R�R�R�RUtremove(R�R�((s)/sys/lib/python2.7/bsddb/test/test_all.pytget_new_database_path	s
tTMPDIRttmps
z-Berkeley_DBcCstjS(N(R�R�(((s)/sys/lib/python2.7/bsddb/test/test_all.pytget_test_path_prefixscCs
|t_dS(N(R�R�(R�((s)/sys/lib/python2.7/bsddb/test/test_all.pytset_test_path_prefixscCstjtj�dS(N(R~R�R�R�(((s)/sys/lib/python2.7/bsddb/test/test_all.pytremove_test_path_directorystLockcBseZd�Zd�ZRS(cCsdS(N((R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�&scCsdS(N((R((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�(s(RRR�R�(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�%s	tPrintInfoFakeTestcBseZd�ZRS(cCst�dS(N(R�(R((s)/sys/lib/python2.7/bsddb/test/test_all.pyttestPrintVersions0s(RRR�(((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�/ssWork to do!tcCs�ddddddddd	d
ddd
ddddddddddg}tj�}x_|D]W}t||t�t�|�}|j|j��|r^|jtj|��q^q^W|S(Nttest_associatettest_basicst
test_dbenvttest_dbttest_comparettest_compatttest_cursor_pget_bugt
test_dbobjt
test_dbshelvet
test_dbtablesttest_distributed_transactionsttest_early_closettest_fileidt
test_get_nonet	test_joint	test_lockt	test_miscttest_picklet
test_queuet
test_recnottest_replicationt
test_sequencettest_thread(tunittestt	TestSuitet
__import__tglobalstlocalstaddTestt
test_suitet	makeSuite(t
module_prefixttiming_checkttest_modulestalltestsR�tmodule((s)/sys/lib/python2.7/bsddb/test/test_all.pytsuite?s<	
cCs&tj�}|jtjt��|S(N(R�R�R�R�R�(R�((s)/sys/lib/python2.7/bsddb/test/test_all.pyR�gst__main__tdefaultTestR�(ii(Nt__doc__R�R�R�tbsddb3RCtImportErrortversion_infoRRaRRR*R=R>RktstringtxrangeRGtchrtlettersRDRsRfRtRERR�R
RlRuRqtFalseRrtTrueRwRxRyRzR{R|R}R~ttestRt	threadingR�R�R�thave_threadsR�targvR�R�R�R�R�tos.pathR�RdtenvironR7tsepR�R%R�R�R�R�R�tTestCaseR�ttest_alltstderrR�R�Rtmain(((s)/sys/lib/python2.7/bsddb/test/test_all.pyt<module>s�
-��+	
	
>
>
	


			
		$				
(	

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.