python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_dbm.cpython-311.opt-2.pyc

eP	ddlZddlZddlZddlmZddlmZ	ddlmZn
#e$rdZYnwxYwejZ	ej
e	ejZdZ
dZdZGdd	ZGd
dejZe
D]7ZejddZd
eZeeeejfdeiee<8edkrejdSdS)N)
import_helper)	os_helper)ndbmc#KtjD]9}	t|dg}n#t$rY"wxYw|tj|<|V:dS)Nopen)fromlist)dbm_names
__import__ImportError_modules)namemods  A/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_dbm.pydbm_iteratorrss
	TVH555CC			H	 T				
s%
22c8tjtdSN)rrmtreedirnamercleaunup_test_dirr s
WrcTttjtdSr)rosmkdirrrrrsetup_test_dirr#s$HWrceZdZdddddddZdZd	Zd
ZdZdZd
Z	dZ
dZdZdZ
dZdZdZdZdZdZdZdS)AnyDBMTestCasesPython:sProgrammingstheswaysGuidosintended)abcdfgctjtd}|jD]%}|j|||d<&|dS)Nnascii)r	r_fname_dictencodeclose)selfr#ks   rinit_dbzAnyDBMTestCase.init_db1sTHVS!!	1	1A#':a=Aahhw  						rctd|D}t|j}||||S)Nc3@K|]}|dVdS)r'N)decode).0r-s  r	<genexpr>z-AnyDBMTestCase.keys_helper.<locals>.<genexpr>8s.::Aahhw''::::::r)sortedkeysr)assertEqual)r,r#r5dkeyss    rkeys_helperzAnyDBMTestCase.keys_helper7sZ:::::::tz(())u%%%rcj|t|jjtdSr)
assertTrue
issubclassmoduleerrorOSErrorr,s r
test_errorzAnyDBMTestCase.test_error=s)
4;#4g>>?????rcf|tjtjtdSr)assertRaisesr	r=rr(r?s rtest_anydbm_not_existingz'AnyDBMTestCase.test_anydbm_not_existing@s$#)SXv66666rcPtjtd}|t	|g|jD]%}|j|||d<&|||	dS)Nr!r')
r	rr(r6listr5r)r*read_helperr+r,r#keys   rtest_anydbm_creationz#AnyDBMTestCase.test_anydbm_creationCsHVS!!affhh,,,:	5	5C%)Z_Acjj!!""						rctjttjtd5}|t
|dddddS#1swxYwYdS)Nr&r)rcreate_empty_filer(r	rr6lenr,r#s  r8test_anydbm_creation_n_file_exists_with_invalid_contentszGAnyDBMTestCase.test_anydbm_creation_n_file_exists_with_invalid_contentsKs#F+++
Xfc
"
"	(aSVVQ'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s$A%%A),A)c^|tjtd}dx|jd<|d<||||ddd||dd|dS)Nr!sindentedr$gxxxfoo)	r.r	rr(r)rFr6
setdefaultr+rMs  rtest_anydbm_modificationz'AnyDBMTestCase.test_anydbm_modificationQsHVS!!$//
3!D'ff55v>>>6F+++						rc4|tjtd}||||d|jd||ddd||d|	t5|ddddn#1swxYwY|dS)NrarrQrR)r.r	rr(rFr6getr)assertIsNonerBKeyErrorr+rMs  rtest_anydbm_readzAnyDBMTestCase.test_anydbm_read[sHVS!!tdjo666vv..777!%%--(((


x
(
(		
fII																					s$	C99C=C=c|tjtd}||}|dS)NrV)r.r	rr(r8r+)r,r#r5s   rtest_anydbm_keyszAnyDBMTestCase.test_anydbm_keysgsDHVS!!""						rc~ttjdddkr|dtjt
d}||gd|d<||dg|d|||dd||	dd||
dd|dS)NlibraryzBerkeley DBzCBerkeley DB doesn't distinguish the empty value from the absent oner!rsempty)getattrr	_defaultmodskipTestrr(r6r5assertInrXrSr+rMs  rtest_empty_valuezAnyDBMTestCase.test_empty_valuems3?It44
EEMM0
1
1
1HVS!!2&&&(H:...

h"""8c***x#...h//555						rc|tjtd}dd}||||dS)NrVrr')r.r	rr(r*rcr+rGs   rtest_anydbm_accessz!AnyDBMTestCase.test_anydbm_access{sVHVS!!jj!!

c1						rctjtjtddSNr!)r	rrfsencoder(r+r?s rtest_open_with_bytesz#AnyDBMTestCase.test_open_with_bytess0V$$c**0022222rctjtjtddSrh)r	rrFakePathr(r+r?s rtest_open_with_pathlib_pathz*AnyDBMTestCase.test_open_with_pathlib_paths1#F++S117799999rctjtjt	jtddSrh)r	rrrlrrir(r+r?s r!test_open_with_pathlib_path_bytesz0AnyDBMTestCase.test_open_with_pathlib_path_bytess;#BK$7$788#>>DDFFFFFrc||}|jD]<}||j|||d=dS)Nr')r8r)r6r*)r,r#r5rHs    rrFzAnyDBMTestCase.read_helpersd"":	F	FCTZ_a

70C0C.DEEEE	F	FrcTtjtd5|gddg}|D]
\}}||<|ttd|D|D]7\}}|||||8|d|tfdddddS#1swxYwYdS)Nr!)rWb)s12345678910s019237410982340912840198242c3 K|]	\}}|V
dSrr)r2r-vs   rr3z+AnyDBMTestCase.test_keys.<locals>.<genexpr>s&5H5HFQa5H5H5H5H5H5HrrQcdS)NrQr)r"sr<lambda>z*AnyDBMTestCase.test_keys.<locals>.<lambda>s&	r)
r	rr(r6r5r4rcassertNotInrBrZ)r,rr-rtr"s    @r	test_keyszAnyDBMTestCase.test_keysst
Xfc
"
"
	;aQVVXXr***OPA

1!VAFFHH--v5H5Ha5H5H5H/H/HIII
*
*1

a###  1q))))VQ'''h(9(9(9(9:::
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;
	;sC4DD!$D!c|ttdtj|jt_|t
t
dS)Nra)
addCleanupsetattrr	rar<rrr?s rsetUpzAnyDBMTestCase.setUpsJmS_EEE+)***rN)__name__
__module____qualname__r)r.r8r@rCrIrNrTr[r]rdrfrjrmrorFrxr|rrrrr(s: 

E@@@777(((


333:::GGGFFF
;;;rrcPeZdZdZejeddZdZdS)WhichDBTestCasecf|ttdtjt	jt}ttjt|tj|g}tD]'}|j
}t|t_|td5dddn#1swxYwY|D]0}|
||j|1|td5}d|d<|d||
|dddddn#1swxYwY|D]0}|
||j|1)dS)Nrar!w1)rzr{r	rarrir(rrlrr}rrr6whichdbrc)r,_bytes_fnamefnamesr<rpathr#s       rtest_whichdbzWhichDBTestCase.test_whichdbsmS_EEE{6**),V44	 2< @ @B"nn	?	?F?D$COVS))/////////////////
?
?  tx'7'7'='=>>>>VS))
0Q$

dA&&&  4$///
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
?
?  tx'7'7'='=>>>>
?#	?	?s$CC	C	-8E11E5	8E5	zTest requires ndbm)reasoncdttdzd5dddn#1swxYwYtjt}tt	jt|t	j|g}|D]/}||j|0dS)Nz.dbwb)	rr(rrirrlrYr	r)r,rrrs    rtest_whichdb_ndbmz!WhichDBTestCase.test_whichdb_ndbms&5.$
'
'-----------------{6**),V44	 2< @ @B	6	6Ddh..t445555	6	6s&**c|tttjd|_dS)Nr	)rzrrrimport_fresh_moduler	r?s rr|zWhichDBTestCase.setUps7)*** 4U;;rN)	r}r~rrunittest
skipUnlessrrr|rrrrrsa???2X&:;;;66<;6<<<<<rr	TestCase_r<__main__)rr	rtest.supportrrrrTESTFNrrjoinr(rrrrTestCaserrr}suffixtestnametypeglobalsmainrrr<module>rsC



				&&&&&&""""""DDD
	gy/	0	0

zzzzzzzzz'<'<'<'<'<h''<'<'<T<>>00C
\!""
F#6##H$x .0AB (#00GGIIh
zHMOOOOOs",,