+
    Bi                          ^ RI t ^ RIt^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
HtHtHt ]P                  ! R4      t]t ! R R]P"                  4      t]R8X  d   ]P(                  ! 4        R# R# )	    N)support)cpython_onlyimport_helper)TESTFNTESTFN_NONASCIIFakePathcreate_empty_filetemp_dirunlinkzdbm.gnuc            	         a  ] tR t^t o ]R 4       tR tR t]R 4       t	R t
R tR tR tR	 tR
 tR tR tR tR tR t]P,                  ! ]R4      R 4       tR tR tR tR tR t]P>                  ! RRRRRRR4      R 4       t Rt!V t"R # )!TestGdbmc                     \         P                  '       d    ^ RIHp  \	        RV  24       R# R#   \
         d     R# i ; i)r   )_GDBM_VERSIONzgdbm version: N)r   verbose_gdbmr   printImportError)versions    (/usr/lib/python3.14/test/test_dbm_gnu.py
setUpClassTestGdbm.setUpClass   s=    ???2: wi01   s   0 ??c                    R V n         R # Ngselfs   &r   setUpTestGdbm.setUp   s	        c                t    V P                   e   V P                   P                  4        \        \        4       R # r   )r   closer   filenamer   s   &r   tearDownTestGdbm.tearDown   s!    66FFLLNxr    c                    \         P                  \        R 4      V n        \        P
                  ! V \        V P                  4      4       R# cN)gdbmopenr#   r   r   check_disallow_instantiationtyper   s   &r   test_disallow_instantiation$TestGdbm.test_disallow_instantiation   s.     8S),,T4<@r    c                "   \         P                  \        R 4      V n        V P	                  V P                  P                  4       . 4       RV P                  R&   RV P                  R&   RV P                  R&   \        V P                  P                  4       4      pV P	                  V\        . RO4      4       V P                  RV P                  4       V P                  RV P                  4       V P	                  V P                  R,          R4       V P                  P                  4       pV'       d@   V P                  W!4       VP                  V4       V P                  P                  V4      pKG  V P	                  V P                  P                  R4      R4       V P                  V P                  P                  R	4      4       V P	                  V P                  P                  R	R
4      R
4       V P                  \        4      ;_uu_ 4        V P                  R,           RRR4       V P	                  V P                  P                  R	R
4      R
4       V P	                  V P                  R	,          R
4       R#   + '       g   i     La; i)r(   ba01923741098234091284019824212345678910s   data   bytes   a   bs   xxxs   fooxxxN)r5   r4   s   12345678910)r)   r*   r#   r   assertEqualkeyssetassertInfirstkeyremovenextkeygetassertIsNoneassertRaisesKeyError
setdefault)r   key_setkeys   &  r   test_key_methodsTestGdbm.test_key_methods%   s   8S)+s =}"xdffkkm$#&F"GHc466"dDFF#)73ffooMM#'NN3&&..%CD)40$&&**V,-FF3V<x((FF5M )**66:FC0 )(s   I>>J	c                  a  \        \        4       S P                  \        P                  \        P
                  \        R 4       \        P                  \        R4      S n        S P                  P                  4        S P                  \        P                  V 3R l4       S P                  \        P                  R 4       R# )rr(   c                  *   < S P                   R ,          # )r1   r   r   s   r   <lambda>0TestGdbm.test_error_conditions.<locals>.<lambda>E   s    dffSkr    c                  R    \         P                  \        R 4      P                  4       # )rx)r)   r*   r#   r"    r    r   rK   rL   G   s    dii$.G.M.M.Or    N)r   r#   rA   r)   errorr*   r   r"   r   s   fr   test_error_conditionsTestGdbm.test_error_conditions>   sp    x$**dii3?8S)$**&9:$**&OPr    c                   \        \        P                  4      pV\        R 4      ,
          p\        V4       F<  p\        P	                  \
        V4      V n        V P                  P                  4        K>  	  V\        R4      ,
          pV FK  pV FB  p\        P	                  \
        W5,           4      V n        V P                  P                  4        KD  	  KM  	  R# )fsucrwnN)r:   r)   
open_flagssortedr*   r#   r   r"   )r   allmodesmodeflagsflags   &     r   
test_flagsTestGdbm.test_flagsI   s    $//"c%j 5MDYYx.DFFFLLN "
 c&k!D8T[9  r    c                t   \         P                  \        R 4      V n        \        P
                  P                  \        4      p\        VR4      pRV,          V P                  R&   \        P
                  P                  \        4      pV P                  W14       V P                  R V P                  \        P
                  P                  \        4      V4       V P                  P                  4        \        P
                  P                  \        4      pV P                  WC4       V P                  WA4       R# )r(   i'  xN)r)   r*   r#   r   ospathgetsizemaxassertGreaterr8   
reorganize
assertLessassertGreaterEqual)r   size0
value_sizesize1size2s   &    r   test_reorganizeTestGdbm.test_reorganizeY   s    8S))
 &
J&s)5(FF3K2E:)%-r    c                L   \         P                  \        R 4      ;_uu_ 4       pRVR&   RRR4       \         P                  \        R4      ;_uu_ 4       pV P                  \	        VP                  4       4      R.4       RRR4       V P                  \         P                  4      ;_uu_ 4       pXP                  4        RRR4       V P                  \        XP                  4      R4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L]; i)r(   zcontext managerzgdbm context managerNrI   s   gdbm context managerz#GDBM object has already been closed)
r)   r*   r#   r8   listr9   rA   rP   str	exception)r   dbcms   &  r   test_context_managerTestGdbm.test_context_managern   s    YYx%%):B%& & YYx%%T"'')_/F.GH & tzz**bGGI +R\\*>	@ &% &% +*s#   C-+D -D-C=	 D	D#	c                    \         P                  \        R 4      ;_uu_ 4       pV P                  \	        V4      4       RRR4       R#   + '       g   i     R# ; ir'   )r)   r*   r#   assertFalseboolr   rs   s   & r   test_bool_emptyTestGdbm.test_bool_emptyz   s6    YYx%%T"X& &%%%s   AA	c                    \         P                  \        R 4      ;_uu_ 4       pRVR&   V P                  \	        V4      4       RRR4       R#   + '       g   i     R# ; ir(   r0   r1   N)r)   r*   r#   
assertTruery   rz   s   & r   test_bool_not_emptyTestGdbm.test_bool_not_empty~   s=    YYx%%BsGOODH% &%%%s    AA	c                    \         P                  \        R 4      ;_uu_ 4       pRVR&   RRR4       V P                  \         P                  \
        X4       R#   + '       g   i     L7; ir~   )r)   r*   r#   rA   rP   ry   rz   s   & r   test_bool_on_closed_db_raises&TestGdbm.test_bool_on_closed_db_raises   sB    YYx%%BsG &$**dB/ &%s   AA(	c                   \         P                  \        R 4      ;_uu_ 4       pRVR&   RRR4       \         P                  \        R4      ;_uu_ 4       pV P                  \	        VP                  4       4      R.4       V P                  RV9   4       V P                  VR,          R4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r(   s   bytes value s   bytes key NrI   )r)   r*   r#   r8   rp   r9   r   rz   s   & r   
test_bytesTestGdbm.test_bytes   s    YYx%%$7B ! &YYx%%T"'')_/@.ABOO-34R 124GH &% &%%%%s   B5AC5C	C	c                   \         P                  \        R 4      ;_uu_ 4       pRVR&   RRR4       \         P                  \        R4      ;_uu_ 4       pV P                  \	        VP                  4       4      RP                  4       .4       V P                  RP                  4       V9   4       V P                  RV9   4       V P                  VRP                  4       ,          RP                  4       4       V P                  VR,          RP                  4       4       RRR4       R#   + '       g   i     EL; i  + '       g   i     R# ; i)r(   u   Unicode value 🐍u   Unicode key 🐍NrI   )r)   r*   r#   r8   rp   r9   encoder   rz   s   & r   test_unicodeTestGdbm.test_unicode   s    YYx%%+EB'( &YYx%%T"'')_/G/N/N/P.QROO4;;=CDOO4:;R 8 ? ? AB7>>@BR 897>>@B &% &%%%%%s   D(CD<(D9	<E	c           	        \         P                  \        R 4      ;_uu_ 4       pRVR&   RRR4       \         P                  \        R4      ;_uu_ 4       pV P                  \         P                  4      ;_uu_ 4        VR RRR4       V P                  \         P                  4      ;_uu_ 4        VR RRR4       V P                  \         P                  4      ;_uu_ 4        RVR&   RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lu; i  + '       g   i     LS; i  + '       g   i     R# ; i)r(   s   bytes values	   bytes keyNrI   s   not exist keys   not exist value)r)   r*   r#   rA   rP   rz   s   & r   test_write_readonly_file!TestGdbm.test_write_readonly_file   s    YYx%%-B| &YYx%%""4::..'( /""4::..|$ /""4::..'9#$ / &% &% /..... &%%s_   C9(E;D	?/E.D	2/E!D2	'E9D		DED/*E2E=EE	z*requires OS support of non-ASCII encodingsc                <   \         pV P                  \        V4       \        P	                  VR 4      ;_uu_ 4       pRVR&   RRR4       V P                  \        P                  P                  V4      4       \        P	                  VR4      ;_uu_ 4       pV P                  \        VP                  4       4      R.4       V P                  RV9   4       V P                  VR,          R4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r(   s   values   keyNrI   )r   
addCleanupr   r)   r*   r   ra   rb   existsr8   rp   r9   )r   r#   rs   s   &  r   test_nonascii_filenameTestGdbm.test_nonascii_filename   s     #)YYx%%!BvJ &x01YYx%%T"'')_vh7OOFbL)RZ2 &% &% &%%s   C7AD
7D	
D	c                P   R pV P                  \        P                  4      ;_uu_ 4       p\        P                  V4       RRR4       V P	                  V\        XP                  4      4       V P                  VP                  P                  V4       R#   + '       g   i     L]; i)znonexisting-fileN)	rA   r)   rP   r*   r;   rq   rr   r8   r#   )r   nonexisting_filert   s   &  r   test_nonexisting_fileTestGdbm.test_nonexisting_file   sm    -tzz**bII&' +&BLL(9:..0@A +*s   BB%	c                h    \         P                  \        \        4      R 4      P	                  4        R# r'   )r)   r*   r   r#   r"   r   s   &r   test_open_with_pathlib_path$TestGdbm.test_open_with_pathlib_path   s    		(8$c*002r    c                ~    \         P                  \        P                  ! \        4      R 4      P                  4        R# r'   )r)   r*   ra   fsencoder#   r"   r   s   &r   test_open_with_bytes_path"TestGdbm.test_open_with_bytes_path   s"    		"++h'-335r    c                    \         P                  \        \        P                  ! \
        4      4      R 4      P                  4        R# r'   )r)   r*   r   ra   r   r#   r"   r   s   &r   !test_open_with_pathlib_bytes_path*TestGdbm.test_open_with_pathlib_bytes_path   s'    		(2;;x0137==?r    c                   RR.p\         P                  \        R4      ;_uu_ 4       pV F  w  r4WBV&   V P                  W24       K  	  V P	                  \        V4      \        V4      4       VP                  4        V F  w  r4V P                  W24       K  	  V P	                  \        V4      ^ 4       RRR4       R#   + '       g   i     R# ; i)foor(   N)r   bar)12345678)r)   r*   r#   r;   r8   lenclearassertNotIn)r   kvsrs   kvs   &    r   
test_clearTestGdbm.test_clear   s    /0YYx%%1a$  SWc#h/HHJ  ' SWa( &%%%s   BB==C	LC_ALLzfr_FR.iso88591z
ja_JP.sjisz	zh_CN.gbkz
fr_FR.utf8z
en_US.utf8 c                   \        4       ;_uu_ 4       p\        \        P                  P	                  VR 4      4       V P                  \        P                  \        P                  \        R4       RRR4       R#   + '       g   i     R# ; i)testrI   N)
r
   r	   ra   rb   joinrA   r)   rP   r*   r#   )r   ds   & r   test_localized_errorTestGdbm.test_localized_error   sL     ZZ1bggll1f56djj$))XsC ZZZs   AA;;B	r   N)#__name__
__module____qualname____firstlineno__staticmethodr   r   r$   r   r-   rF   rQ   r]   rm   ru   r{   r   r   r   r   r   unittest
skipUnlessr   r   r   r   r   r   r   r   run_with_localer   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     2 2
 A A
12	Q .*
@'&
0
I
B	: EG	3G	3B36@) ,l
	DDr    r   __main__)ra   r   r   r   test.supportr   r   test.support.os_helperr   r   r   r	   r
   r   import_moduler)   r#   TestCaser   r   mainrO   r    r   <module>r      sc    	   4I I ""9-NDx   NDb zMMO r    