config root man

Current Path : /usr/local/lib/python2.5/bsddb/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyc

³ò
h”Rc@s
dZddkZddkZddkZddkZddkZddklZddkTddkZyddk	l
Z
lZWn)ej
oddk
l
Z
lZnXddklZdd%d„ƒYZd	eifd
„ƒYZdefd„ƒYZd
efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!„Zed"joei d#d$ƒndS(&s*
TestCases for checking dbShelve objects.
iÿÿÿÿN(tpprint(t*(tdbtdbshelve(tverboset	DataClasscBseZd„Zd„ZRS(cCstiƒ|_dS(N(trandomtvalue(tself((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt__init__scCst|i|ƒS(N(tcmpR(Rtother((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt__cmp__s(t__name__t
__module__R	R(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRs	tDBShelveTestCasecBsbeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
cCstiƒ|_|iƒdS(N(ttempfiletmktemptfilenametdo_open(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pytsetUp!scCs;|iƒyti|iƒWntij
onXdS(N(tdo_closetostremoveRterror(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyttearDown%s

cCs|S(s1Turn key into an appropriate key type for this db((Rtkey((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pytmk,scCsºx³tiD]¨}d|||id|ƒ<t|ƒ||id|ƒ<|gd||id|ƒ<tƒ}d||_t|ƒ|_|gd|_|||id|ƒ<q
WdS(Ni
tStItLtO(tstringtlettersRtordRRRR(Rtdtxtinst((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt
populateDB1s
	
cCsti|iƒ|_dS(N(RtopenRR#(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR?scCs|iiƒdS(N(R#tclose(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRCsc	Csto dGddGHd|iiGHn|i|iƒ|iiƒ|iƒ|iƒ|i}t|ƒ}|i	ƒ}|i
ƒ}|iƒ}todG|GHdG|GHdG|GHnd|i|i
d	ƒƒjpt‚d
|i|i
dƒƒjpt‚d
|i|i
dƒƒjpt‚|i|i
dƒƒ||i
dƒ=d|i|i
dƒƒjpt‚d|i|i
dƒƒjpt‚t|ƒ|d
jpt‚g}xU|i	ƒD]G}||}|i|ƒtod||fGHn|i||ƒqÌW|iƒ}	t|	ƒt|i	ƒƒjpt‚|iƒ|	iƒ||	jpt‚|iƒ}
t|
ƒt|ƒjpt‚x$|
D]\}}|i||ƒq¤W|i|i
d	ƒƒdjpt‚|i|i
d	ƒdƒdjpt‚|i|i
d	ƒdƒdjpt‚|i|i
d	ƒd
d
dgƒd
d
dgjpt‚|idƒ|iti|i|i
d	ƒƒ|id
ƒ|i|i
dƒdƒ|i|i
dƒƒdjpt‚||i
dƒdjpt‚dS(Ns
s-=isRunning %s.test01_basics...slength:skeys:sstats:isbad keyitIAtOAis%s: %ssa stringisnew keysnew data(Rt	__class__R
R&R#tsyncRRtlentkeyststattfdthas_keyRtAssertionErrortdeletetappendtcheckrectvaluestsorttitemstgettNonetset_get_returns_nonetassertRaisesRtDBNotFoundErrortput(RR#tltktstfR6RRtdbvaluesR8((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt
test01_basicsHsh



			
&&&&&


&

 &));
"
&cCs to dGddGHd|iiGHn|i|iƒ|i}d}|iƒ}|iƒ}xT|dj	oF|d}to	|GHn|\}}|i||ƒ|i	ƒ}qaW~|t
|ƒjpt‚d}|iƒ}|iƒ}xT|dj	oF|d}to	|GHn|\}}|i||ƒ|i
ƒ}qóW|t
|ƒjpt‚|i|idƒƒ|iƒ\}}|i||ƒ~dS(Ns
s-=isRunning %s.test02_cursors...iitSS(RR+R
R&R#tcursortfirstR:R5tnextR-R2tlasttprevtsetRtcurrent(RR#tcounttctrecRR((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyttest02_cursorsŠsD
	

	

	cCsGto dGddGHd|iiGHn|iti|iidƒdS(Ns
s-=isRunning %s.test03_append...sunit test was here(RR+R
R<Rt
DBShelveErrorR#R4(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt
test03_append³s

cCsv|d}|ddjo6t|ƒtjpt‚|d|jpt‚n"|ddjo8t|ƒtjpt‚|t|ƒjpt‚nÙ|ddjo9t|ƒtjpt‚||gdjpt‚n|ddjott|ƒtjpt‚|id|jpt‚|it|ƒjpt‚|i	|gdjpt‚n
td‚dS(	NiiRi
RRRsUnknown key type, fix the test(
ttypet
StringTypeR2tIntTypeR"tListTypetInstanceTypeRRR(RRRR$((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR5½s 
"(R
RRRRR&RRRDRPRRR5(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR s							B	)	
tBasicShelveTestCasecBseZd„Zd„ZRS(cCs2tiƒ|_|ii|i|i|iƒdS(N(RtDBShelfR#R'Rtdbtypetdbflags(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRØscCs|iiƒdS(N(R#R((R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRÜs(R
RRR(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRX×s	tBTreeShelveTestCasecBseZeiZeiZRS((R
RRtDB_BTREERZt	DB_CREATER[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR\às	tHashShelveTestCasecBseZeiZeiZRS((R
RRtDB_HASHRZR^R[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR_ås	tThreadBTreeShelveTestCasecBs!eZeiZeieiBZRS((R
RRR]RZR^t	DB_THREADR[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRaês	tThreadHashShelveTestCasecBs!eZeiZeieiBZRS((R
RRR`RZR^RbR[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRcïs	tBasicEnvShelveTestCasecBs#eZd„Zd„Zd„ZRS(cCsàtiitiitidƒdƒ|_}yti|ƒWntij
onXt	i
ƒ|_|ii||i
t	iBt	iBƒtii|iƒd|_ti|iƒ|_|ii|i|i|iƒdS(Nitdb_homei(RtpathtjointdirnametsystargvthomeDirtmkdirRRtDBEnvtenvR'tenvflagst
DB_INIT_MPOOLR^tsplitRRRYR#RZR[(RRk((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR÷s	&$cCs|iiƒ|iiƒdS(N(R#R(Rn(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRs
cCsY|iƒddk}|itii|idƒƒ}x|D]}ti|ƒq>WdS(NiÿÿÿÿR(RtglobRRfRgRkR(RRrtfilestfile((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR	s
!(R
RRRR(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRdös	
	tEnvBTreeShelveTestCasecBs eZdZeiZeiZRS(i(R
RRoRR]RZR^R[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRus	tEnvHashShelveTestCasecBs eZdZeiZeiZRS(i(R
RRoRR`RZR^R[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRvs	tEnvThreadBTreeShelveTestCasecBs*eZeiZeiZeieiBZRS((	R
RRRbRoR]RZR^R[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRws		tEnvThreadHashShelveTestCasecBs*eZeiZeiZeieiBZRS((	R
RRRbRoR`RZR^R[(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRx$s		tRecNoShelveTestCasecBs>eZeiZeiZd„Zd„Zd„Z	d„Z
RS(cCs;ti|ƒttddƒƒ|_h|_h|_dS(Niiˆ(RXRtlisttrangetkey_pooltkey_mapt
intkey_map(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR1s
	cCsL||ijo1|iidƒ|i|<||i|i|<n|i|S(Ni(R}R|tpopR~(RR((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR9scCs$|i|}ti|||ƒdS(N(R~RXR5(RtintkeyRR((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyR5?s
cCsíto dGddGHd|iiGHnd|id<d|id<|id	|iidƒƒ|id
|iidƒƒ|id|iid	ƒƒ|id|iidƒƒ|id|iid
ƒƒ|id|iidƒƒdS(Ns
s-=isRunning %s.test03_append...tspamiteggsiiisbaked beans(RR+R
R#tassertEqualR4R9(R((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRRCs


(R
RRtDB_RECNORZR^R[RRR5RR(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyRy-s					cCsìtiƒ}|ititƒƒ|ititƒƒ|ititƒƒ|ititƒƒ|ititƒƒ|itit	ƒƒ|itit
ƒƒ|ititƒƒ|ititƒƒ|itit
ƒƒ|S(N(tunittestt	TestSuitetaddTestt	makeSuiteRR\R_RaRcRuRvRwRxRy(tsuite((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pyt
test_suiteTst__main__tdefaultTestRŠ((!t__doc__RiRR RRRttypesR…tbsddb3RRtImportErrortbsddbttest_allRRtTestCaseRRXR\R_RaRcRdRuRvRwRxRyRŠR
tmain(((s4/usr/local/lib/python2.5/bsddb/test/test_dbshelve.pys<module>s4$
·		'	


Man Man