python (3.11.7)

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

eddlmZddlmZejdddlZddlZddlZddlmZGddej	Z
edkrejdSdS)	)
import_helper)	os_helperzdbm.ndbmN)errorceZdZdZdZdZdZdZdZdZ	dZ
d	Zej
ejd
dZdZd
ZdZdZdS)DbmTestCasectj|_tj|jd|_|jdSNc)rTESTFNfilenamedbmndbmopendcloseselfs F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_dbm_ndbm.pysetUpzDbmTestCase.setUps8!(
t}c22cHdD]}tj|j|zdS)Nz.pagz.dirz.db)runlinkr)rsuffixs  rtearDownzDbmTestCase.tearDowns61	5	5FT]V34444	5	5rc4tj|jd|_||jgd|jd<d|jd<d|jd<|j|d|j|d|j||jdd||jdd	|	|jd
||jd
dd|
t5|jddddn#1swxYwY||jd
dd||jd
d|j
dS)
Nr
basdatasbytes01923741098234091284019824212345678910absxxxsfooxxx)r
rrrrassertEqualkeysassertIngetassertIsNoneassertRaisesKeyError
setdefaultrrs r	test_keyszDbmTestCase.test_keysst}c22+++s"x =}




c46"""

dDF###)7333D))4000$&**V,,---FF33V<<<


x
(
(		F5MM															**66::FCCC000s
F$$F(+F(ctjjdkr|dtj|jd|_||jgd|jd<||jdg|	d|j||jdd||j
dd||jdd|jdS)NzBerkeley DBzCBerkeley DB doesn't distinguish the empty value from the absent oner
remptysemptyr)
r
rlibraryskipTestrrrr%r&r'r(r,rrs rtest_empty_valuezDbmTestCase.test_empty_value(s#8},,MM0
1
1
1t}c22+++w
333

h''')3///H--s333**844c:::rcdD]j}	tj|j||_|jG#t$r|YgwxYwdS)N)rrwwn)r
rrrrrrfail)rmodes  r
test_modeszDbmTestCase.test_modes6sv)		D
t}d;;


		
			sAA

A+*A+c`tj|jd5}d|d<dddn#1swxYwYtj|jd5}|t|dgdddn#1swxYwY|tjj5}|dddn#1swxYwY|t|j
ddS)Nr
zcontext managerzndbm context managerr4sndbm context managerz"DBM object has already been closed)r
rrrr%listr&r*rstr	exception)rdbcms   rtest_context_managerz DbmTestCase.test_context_manager>s
X]]4=#
.
.	;"):B%&	;	;	;	;	;	;	;	;	;	;	;	;	;	;	;X]]4=#
.
.	I"T"''))__/F.GHHH	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I

sx~
.
.	"GGIII															R\**=	?	?	?	?	?s08<<(7B++B/2B/C;;C?C?ctj|jd5}d|d<dddn#1swxYwYtj|jd5}|t|dg|d|v||ddddddS#1swxYwYdS)Nr
s
bytes value sbytes key r4)r
rrrr%r<r&
assertTruerr?s  r
test_byteszDbmTestCase.test_bytesJs`
X]]4=#
.
.	8"$7B !	8	8	8	8	8	8	8	8	8	8	8	8	8	8	8
X]]4=#
.
.	I"T"''))__/@.ABBBOO-3444R 124GHHH	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I	Is8<<(A*CC#&C#ctj|jd5}d|d<dddn#1swxYwYtj|jd5}|t|dg|d|v|d|v||dd||ddddddS#1swxYwYdS)Nr
uUnicode value 🐍uUnicode key 🐍r4)	r
rrrr%r<r&encoderCrDs  rtest_unicodezDbmTestCase.test_unicodeRs
X]]4=#
.
.	F"+EB'(	F	F	F	F	F	F	F	F	F	F	F	F	F	F	F
X]]4=#
.
.	B"T"''))__/G/N/N/P/P.QRRROO4;;==CDDDOO4:;;;R 8 ? ? A AB7>>@@
B
B
BR 897>>@@
B
B
B
	B	B	B	B	B	B	B	B	B	B	B	B	B	B	B	B	B	Bs8<<(C7E,,E03E0cHtj|jd5}d|d<dddn#1swxYwYtj|jd5}|t
5|d=dddn#1swxYwY|t
5|d=dddn#1swxYwY|t
5d|d<dddn#1swxYwYddddS#1swxYwYdS)Nr
sbytes values	bytes keyr4s
not exist keysnot exist value)r
rrrr*rrDs  rtest_write_readonly_filez$DbmTestCase.test_write_readonly_file^sF
X]]4=#
.
.	."-B|	.	.	.	.	.	.	.	.	.	.	.	.	.	.	.
X]]4=#
.
.	:"""5))
)
)'(
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)""5))
%
%|$
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%""5))
:
:'9#$
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:s8<<(DBDB	DB	D8C<DC	DC	D-C?3D?D	DD	DDDz*requires OS support of non-ASCII encodingsctjdD]%}|tj|z&tjd5}d|d<dddn#1swxYwY|tfddDtjd5}|	t|dg|d|v|	|ddddddS#1swxYwYdS)Nrr
svalueskeyc3\K|]&}tj|zV'dS)N)ospathexists).0rrs  r	<genexpr>z5DbmTestCase.test_nonascii_filename.<locals>.<genexpr>qsRGG &GNN8f+<==GGGGGGrr4)rTESTFN_NONASCII
addCleanuprr
rrrCanyr%r<r&)rrr?rs   @rtest_nonascii_filenamez"DbmTestCase.test_nonascii_filenameis,1	A	AFOOI,h.?@@@@
X]]8S
)
)	"R!BvJ	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"GGGG*EGGGGG	H	H	H
X]]8S
)
)	3RT"''))__vh777OOFbL)))RZ222	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3s%A((A,/A,A*D88D<?D<cPd}|tjj5}tj|dddn#1swxYwY||t
|j||jj	|dS)Nznonexisting-file)
r*r
rrrr'r=r>r%r)rnonexisting_filer@s   rtest_nonexisting_filez!DbmTestCase.test_nonexisting_filexs-


sx~
.
.	,"HMM*+++	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,

&BL(9(9:::.0@AAAAAs AAActjtj|jddSr	)r
rrrFakePathrrrs rtest_open_with_pathlib_pathz'DbmTestCase.test_open_with_pathlib_paths7

i(77==CCEEEEErctjtj|jddSr	)r
rrrMfsencoderrrs rtest_open_with_bytes_pathz%DbmTestCase.test_open_with_bytes_paths6

bk$-00#66<<>>>>>rctjtjtj|jddSr	)	r
rrrrZrMr]rrrs r!test_open_with_pathlib_bytes_pathz-DbmTestCase.test_open_with_pathlib_bytes_pathsA

i(T])C)CDDcJJPPRRRRRrN)__name__
__module____qualname__rrr-r2r:rArErHrJunittest
skipUnlessrrRrUrXr[r^r`rrrr	s!
555(
?
?
?III
B
B
B	:	:	:X2EGG33GG3BBBFFF???SSSSSrr__main__)
test.supportrr
import_modulerMrddbm.ndbmr
rTestCaserramainrfrr<module>rms&&&&&&""""""
J'''				}S}S}S}S}S(#}S}S}S@zHMOOOOOr