%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_dbshelve.pyo

ó
Oêáac@sºdZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZdd"d„ƒYZ
dejfd„ƒYZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zedkr¶ejd d!ƒndS(#s*
TestCases for checking dbShelve objects.
iÿÿÿÿN(tdbtdbshelvettest_supporttverbosetget_new_environment_pathtget_new_database_patht	DataClasscBs#eZd„Zd„Zd„ZRS(cCstjƒ|_dS(N(trandomtvalue(tself((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt__init__scCsd|jS(NsDataClass %f(R(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt__repr__scCst|j|ƒS(N(tcmpR(R	tother((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt__cmp__s(t__name__t
__module__R
RR(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRs		tDBShelveTestCasecBs§eZejdks3ejdkrBejdkrBdd„Znd„Zd„Zd„Zd„Z	d	„Z
d
„Zd„Zd„Z
d
„Zd„Zd„ZRS(iiiicCs|j||kd|ƒS(Ntmsg(t
assertTrue(R	tatbR((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pytassertIn#scCsOtjddkr5ddlm}|tƒ|_ntƒ|_|jƒdS(Niiiÿÿÿÿ(tdo_proxy_db_py3k(	tsystversion_infottest_allRtFalset_flag_proxy_db_py3kRtfilenametdo_open(R	R((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pytsetUp's
cCsQtjddkr3ddlm}||jƒn|jƒtj|jƒdS(Niiiÿÿÿÿ(R(	RRRRRtdo_closeRtunlinkR(R	R((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyttearDown.s

cCs(tjddkr|St|dƒSdS(s1Turn key into an appropriate key type for this dbiis	iso8859-1N(RRtbytes(R	tkey((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pytmk5scCsºx³tjD]¨}d|||jd|ƒ<t|ƒ||jd|ƒ<|gd||jd|ƒ<tƒ}d||_t|ƒ|_|gd|_|||jd|ƒ<q
WdS(Ni
tStItLtO(tstringt
ascii_lettersR%tordRR&R'R((R	tdtxtinst((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt
populateDB=s	
cCstj|jƒ|_dS(N(RtopenRR-(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRKscCs|jjƒdS(N(R-tclose(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR OscCs)tr%dGddGHd|jjGHn|j|jƒ|jjƒ|jƒ|jƒ|j}t|ƒ}|j	ƒ}|j
ƒ}|jƒ}tr³dG|GHdG|GHdG|GHn|jd|j
|jd	ƒƒƒ|jd
|j
|jdƒƒƒ|jd
|j
|jdƒƒƒ|j|jdƒƒ||jdƒ=|jd|j
|jdƒƒƒ|jd|j
|jdƒƒƒ|jt|ƒ|d
ƒg}xS|j	ƒD]E}||}|j|ƒtråd||fGHn|j||ƒq°W|jƒ}	|jt|	ƒt|j	ƒƒƒtjdkr]|jƒ|	jƒ|j||	ƒnB|jdd„ƒ|	jdd„ƒ|jt|ƒt|	ƒƒ|jƒ}
|jt|
ƒt|ƒƒx$|
D]\}}|j||ƒqÎW|j|j|jd	ƒƒdƒ|j|j|jd	ƒdƒdƒ|j|j|jd	ƒdƒdƒ|j|j|jd	ƒd
d
dgƒd
d
dgƒ|jdƒ|jtj|j|jd	ƒƒ|jd
ƒ|j|jdƒdƒ|j|j|jdƒƒdƒ|j||jdƒdƒdS(Ns
s-=isRunning %s.test01_basics...slength:skeys:sstats:isbad keyitIAtOAis%s: %siR$cSs
t|ƒS(N(tstr(R.((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt<lambda>‚tcSs
t|ƒS(N(R5(R.((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR6ƒR7sa stringisnew keysnew data(ii(Rt	__class__RR0R-tsyncR RtlentkeyststattfdtassertEqualthas_keyR%tdeletetappendtcheckrectvaluesRRtsorttreprtitemstgettNonetset_get_returns_nonetassertRaisesRtDBNotFoundErrortput(R	R-tltktstfRCR$RtdbvaluesRF((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt
test01_basicsTsl



			"""""

"

"%%7
"
"cCs”tr%dGddGHd|jjGHn|j|jƒ|j}d}|jƒ}|jƒ}xV|dk	r´|d}trƒ|GHn|\}}|j||ƒt	|dƒƒ}q_W~|j
|t|ƒƒd}|jƒ}|jƒ}xP|dk	r>|d}tr|GHn|\}}|j||ƒ|j
ƒ}qïW|j
|t|ƒƒ|j|jdƒƒ|jƒ\}}|j||ƒ~dS(	Ns
s-=isRunning %s.test02_cursors...iitnexttSS(RR8RR0R-tcursortfirstRHRBtgetattrR>R:tlasttprevtsetR%tcurrent(R	R-tcounttctrecR$R((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyttest02_cursors›s@
	

cCsEtr%dGddGHd|jjGHn|jtj|jjdƒdS(Ns
s-=isRunning %s.test03_append...sunit test was here(RR8RRJRt
DBShelveErrorR-RA(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt
test03_appendÅs

cCs•|j|jƒ|j}|jƒ}t|ƒ}|jt|ƒt|ƒƒx+|D]#}|j||ƒ|j|ƒqTW|jt|ƒdƒdS(Ni(R0R-R;RZR>R:Rtremove(R	R-R;tkeysetR$((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyttest04_iterableÏs	
cCs½tjddkr7t|tƒr7|jdƒ}q7n|d}|ddkr~|jt|ƒtƒ|j|d|ƒn;|ddkr½|jt|ƒtƒ|j|t	|ƒƒnü|ddkrý|jt|ƒt
ƒ|j||gdƒn¼|dd	kr¬tjddkrId
dlm}|jt|ƒ|ƒn|jt|ƒt
ƒ|j|jd|ƒ|j|jt	|ƒƒ|j|j|gdƒn
|jdƒdS(
Niis	iso8859-1iR&i
R'R(R)iÿÿÿÿ(tInstanceTypesUnknown key type, fix the test(RRt
isinstanceR#tdecodeR>ttypeR5tintR,tlistttypesReRR&R'R(tfail(R	R$RR.Re((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRBÛs,
(ii(ii(iiN(RRRRRHRRR"R%R0RR RRR_RaRdRB(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR s							G	*	
	tBasicShelveTestCasecBseZd„Zd„ZRS(cCs2tjƒ|_|jj|j|j|jƒdS(N(RtDBShelfR-R1Rtdbtypetdbflags(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRscCs|jjƒdS(N(R-R2(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR s(RRRR (((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRmÿs	tBTreeShelveTestCasecBseZejZejZRS((RRRtDB_BTREERot	DB_CREATERp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRqs	tHashShelveTestCasecBseZejZejZRS((RRRtDB_HASHRoRsRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRt
s	tThreadBTreeShelveTestCasecBs!eZejZejejBZRS((RRRRrRoRst	DB_THREADRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRvs	tThreadHashShelveTestCasecBs!eZejZejejBZRS((RRRRuRoRsRwRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRxs	tBasicEnvShelveTestCasecBs,eZd„Zd„Zd„Zd„ZRS(cCsŠtjƒ|_|jj|j|jtjBtjBƒtj	j
|jƒd|_tj
|jƒ|_|jj|j|j|jƒdS(Ni(RtDBEnvtenvR1thomeDirtenvflagst
DB_INIT_MPOOLRstostpathtsplitRRRnR-RoRp(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRscCs|jjƒ|jjƒdS(N(R-R2R{(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR )s
cCstƒ|_tj|ƒdS(N(RR|RR(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR.scCsQtjddkr3ddlm}||jƒn|jƒtj|jƒdS(Niiiÿÿÿÿ(R(	RRRRRR RtrmtreeR|(R	R((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR"2s

(RRRR RR"(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRys	
		tEnvBTreeShelveTestCasecBs eZdZejZejZRS(i(RRR}RRrRoRsRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRƒ:s	tEnvHashShelveTestCasecBs eZdZejZejZRS(i(RRR}RRuRoRsRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR„@s	tEnvThreadBTreeShelveTestCasecBs*eZejZejZejejBZRS((	RRRRwR}RrRoRsRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR…Fs		tEnvThreadHashShelveTestCasecBs*eZejZejZejejBZRS((	RRRRwR}RuRoRsRp(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR†Ls		tRecNoShelveTestCasecBs>eZejZejZd„Zd„Zd„Z	d„Z
RS(cCs;tj|ƒttddƒƒ|_i|_i|_dS(Niiˆ(RmRRjtrangetkey_pooltkey_mapt
intkey_map(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRYs
	cCsJ||jkr?|jjdƒ|j|<||j|j|<n|j|S(Ni(RŠR‰tpopR‹(R	R$((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR%ascCs$|j|}tj|||ƒdS(N(R‹RmRB(R	tintkeyRR$((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRBgs
cCsëtr%dGddGHd|jjGHnd|jd<d|jd<|jd	|jjdƒƒ|jd
|jjdƒƒ|jd|jjd	ƒƒ|jd|jjdƒƒ|jd|jjd
ƒƒ|jd|jjdƒƒdS(Ns
s-=isRunning %s.test03_append...tspamiteggsiiisbaked beans(RR8RR-R>RARG(R	((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyRaks


(RRRtDB_RECNORoRsRpRR%RBRa(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyR‡Us					cCsìtjƒ}|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjt	ƒƒ|jtjt
ƒƒ|jtjtƒƒ|jtjtƒƒ|jtjt
ƒƒ|S(N(tunittestt	TestSuitetaddTestt	makeSuiteRRqRtRvRxRƒR„R…R†R‡(tsuite((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt
test_suite|st__main__tdefaultTestR–((t__doc__RR*RRR‘RRRRRRRRtTestCaseRRmRqRtRvRxRyRƒR„R…R†R‡R–Rtmain(((s4/usr/local/lib/python2.7/bsddb/test/test_dbshelve.pyt<module>s($.ß		'	

Zerion Mini Shell 1.0