+
    Bi!                        R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt  ^ RIHt  ^ RIH
t
 ]P                  t]P                  P                  ]]P                  4      tR tR tR t ! R	 R
4      t ! R R]P(                  4      t]! 4        F;  t]P.                  R,          tR] 2t]! ]]]P(                  3R]/4      ]! 4       ]&   K=  	  ]R8X  d   ]P8                  ! 4        R# R#   ]	 d    Rt Li ; i  ]	 d    Rt
 Li ; i)z=Test script for the dbm.open function based on testdumbdbm.pyN)import_helper)	os_helper)sqlite3)ndbmc               #      "   \         P                   F)  p  \        V R .R7      pT\         P                  T &   Tx  K+  	  R#   \         d     K=  i ; i5i)open)fromlistN)dbm_names
__import__ImportError_modules)namemods     $/usr/lib/python3.14/test/test_dbm.pydbm_iteratorr      sN     

	TVH5C !T	   		s'   AAAAAAAc                  :    \         P                  ! \        4       R # N)r   rmtreedirname     r   cleaunup_test_dirr   '   s    Wr   c                  N    \        4        \        P                  ! \        4       R # r   )r   osmkdirr   r   r   r   setup_test_dirr   *   s    HHWr   c                      a  ] tR t^/t o RRRRRRRRR	R
RR/tR tR tR tR tR t	R t
R tR tR tR tR tR tR tR tR tR tR tR tRtV tR # )!AnyDBMTestCaseas   Python:bs   Programmingcs   theds   wayfs   Guidogs   intendedc                    \         P                  ! \        R 4      pV P                   F'  pV P                  V,          WP	                  R4      &   K)  	  VP                  4        R# )nasciiN)r	   r   _fname_dictencodeclose)selfr#   ks   &  r   init_dbAnyDBMTestCase.init_db8   sB    HHVS!A#'::a=Ahhw  		r   c                    \        R  VP                  4        4       4      p\        V P                  P                  4       4      pV P                  W#4       V# )c              3   B   "   T F  qP                  R 4      x  K  	  R# 5ir'   N)decode).0r-   s   & r   	<genexpr>-AnyDBMTestCase.keys_helper.<locals>.<genexpr>?   s     :Ahhw''s   )sortedkeysr)   assertEqual)r,   r#   r8   dkeyss   &&  r   keys_helperAnyDBMTestCase.keys_helper>   s@    :::tzz()%r   c                Z    V P                  V P                  P                  \        4       R # r   )assertIsSubclassmoduleerrorOSErrorr,   s   &r   
test_errorAnyDBMTestCase.test_errorD   s    dkk//9r   c                l    V P                  \        P                  \        P                  \        4       R # r   )assertRaisesr	   r@   r   r(   rB   s   &r   test_anydbm_not_existing'AnyDBMTestCase.test_anydbm_not_existingG   s    #))SXXv6r   c                >   \         P                  ! \        R 4      pV P                  \	        VP                  4       4      . 4       V P                   F'  pV P                  V,          WP                  R4      &   K)  	  V P                  V4       VP                  4        R# )r!   r'   N)
r	   r   r(   r9   listr8   r)   r*   read_helperr+   r,   r#   keys   &  r   test_anydbm_creation#AnyDBMTestCase.test_anydbm_creationJ   sj    HHVS!affh,::C%)ZZ_Ajj!" 		r   c                    \         P                  ! \        4       \        P                  ! \        R 4      ;_uu_ 4       pV P                  \        V4      ^ 4       RRR4       R#   + '       g   i     R# ; i)r&   N)r   create_empty_filer(   r	   r   r9   lenr,   r#   s   & r   8test_anydbm_creation_n_file_exists_with_invalid_contentsGAnyDBMTestCase.test_anydbm_creation_n_file_exists_with_invalid_contentsR   sF    ##F+XXfc""aSVQ' #"""s   A$$A5	c                <   V P                  4        \        P                  ! \        R 4      pR;V P                  R&   VR&   V P                  V4       V P                  VP                  RR4      R4       V P                  VR,          R4       VP                  4        R# )r!   s   indentedr$      g   xxx   fooN)	r.   r	   r   r(   r)   rK   r9   
setdefaultr+   rS   s   & r   test_anydbm_modification'AnyDBMTestCase.test_anydbm_modificationX   sw    HHVS!$//

3!D'ff5v>6F+		r   c                
   V P                  4        \        P                  ! \        R 4      pV P	                  V4       V P                  VP                  R4      V P                  R,          4       V P                  VP                  RR4      R4       V P                  VP                  R4      4       V P                  \        4      ;_uu_ 4        VR,           RRR4       VP                  4        R#   + '       g   i     L"; i)r   ar   rX   rY   N)r.   r	   r   r(   rK   r9   getr)   assertIsNonerF   KeyErrorr+   rS   s   & r   test_anydbm_readAnyDBMTestCase.test_anydbm_readb   s    HHVS!tdjjo6vv.7!%%-(x((fI )		 )(s   
C22D	c                    V P                  4        \        P                  ! \        R 4      pV P	                  V4      pVP                  4        R# )r^   N)r.   r	   r   r(   r;   r+   )r,   r#   r8   s   &  r   test_anydbm_keysAnyDBMTestCase.test_anydbm_keysn   s4    HHVS!"		r   c                $   \        \        P                  R R4      R8X  d   V P                  R4       \        P                  ! \
        R4      pV P                  VP                  4       . 4       RVR&   V P                  VP                  4       R.4       V P                  RV4       V P                  VR,          R4       V P                  VP                  R4      R4       V P                  VP                  R4      R4       VP                  4        R# )libraryNzBerkeley DBzCBerkeley DB doesn't distinguish the empty value from the absent oner!   r   s   empty)getattrr	   _defaultmodskipTestr   r(   r9   r8   assertInr`   rZ   r+   rS   s   & r   test_empty_valueAnyDBMTestCase.test_empty_valuet   s    3??It4EMM 0 1HHVS!2&(H:.h"8c*x#.h/5		r   c                    V P                  4        \        P                  ! \        R 4      pRP	                  R4      pV P                  W!4       VP                  4        R# )r^   r   r'   N)r.   r	   r   r(   r*   rm   r+   rL   s   &  r   test_anydbm_access!AnyDBMTestCase.test_anydbm_access   s>    HHVS!jj!c		r   c                    \         P                  ! \        P                  ! \        4      R 4      P                  4        R# r!   N)r	   r   r   fsencoder(   r+   rB   s   &r   test_open_with_bytes#AnyDBMTestCase.test_open_with_bytes   s"    V$c*002r   c                    \         P                  ! \        P                  ! \        4      R 4      P                  4        R# rt   )r	   r   r   FakePathr(   r+   rB   s   &r   test_open_with_pathlib_path*AnyDBMTestCase.test_open_with_pathlib_path   s$    ##F+S1779r   c                    \         P                  ! \        P                  ! \        P
                  ! \        4      4      R 4      P                  4        R# rt   )r	   r   r   ry   r   ru   r(   r+   rB   s   &r   !test_open_with_pathlib_path_bytes0AnyDBMTestCase.test_open_with_pathlib_path_bytes   s-    ##BKK$78#>DDFr   c                    V P                  V4      pV P                   F;  pV P                  V P                  V,          WP                  R 4      ,          4       K=  	  R# r2   )r;   r)   r9   r*   )r,   r#   r8   rM   s   &&  r   rK   AnyDBMTestCase.read_helper   sD    "::CTZZ_a

70C.DE r   c           	     &  a \         P                  ! \        R 4      ;_uu_ 4       oV P                  SP	                  4       . 4       RR.pV F
  w  r#VSV&   K  	  V P                  \        SP	                  4       4      \        R V 4       4      4       V F0  w  r#V P                  VS4       V P                  SV,          V4       K2  	  V P                  RS4       V P                  \        V3R l4       RRR4       R#   + '       g   i     R# ; i)r!   c              3   *   "   T F	  w  rVx  K  	  R # 5ir   r   )r4   r-   vs   &  r   r5   +AnyDBMTestCase.test_keys.<locals>.<genexpr>   s     5HaFQaas   rX   c                     < S R ,          # )rX   r   )r"   s   r   <lambda>*AnyDBMTestCase.test_keys.<locals>.<lambda>   s	    &	r   Nr_      bs   12345678910s   019237410982340912840198242)
r	   r   r(   r9   r8   r7   rm   assertNotInrF   rb   )r,   r   r-   r   r"   s   &   @r   	test_keysAnyDBMTestCase.test_keys   s    XXfc""aQVVXr*OPA! VAFFH-v5Ha5H/HIa#  1q)  VQ'h(9: #"""s   CC??D	c                   \         P                  ! \        R 4      ;_uu_ 4       pV P                  VP	                  4       . 4       RR.pV F	  w  r4WAV&   K  	  V F  w  r5V P                  W14       K  	  V P                  \        V4      \        V4      4       VP                  4        V P                  \        V4      ^ 4       V F  w  r5V P                  W14       K  	  RRR4       R#   + '       g   i     R# ; i)r!   Nr   r   )	r	   r   r(   r9   r8   rm   rR   clearr   )r,   r"   r   r-   r   _s   &     r   
test_clearAnyDBMTestCase.test_clear   s    XXfc""aQVVXr*OPA! a# SVSV,GGISVQ'  &  #"""s   B;C))C:	c                    V P                  \        \        R \        P                  4       V P                  \        n        V P                  \
        4       \        4        R# )rk   N)
addCleanupsetattrr	   rk   r?   r   r   rB   s   &r   setUpAnyDBMTestCase.setUp   s6    mS__E++)*r   r   N)__name__
__module____qualname____firstlineno__r)   r.   r;   rC   rG   rN   rT   r[   rc   rf   rn   rq   rv   rz   r}   rK   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r   /   s     *.&&(+E:7(
3:GF
;' r   r   c                      a  ] tR t^t o R t]P                  ! ]RR7      R 4       t]P                  ! ]	RR7      R 4       t
]P                  ! ]	RR7      R 4       tR tR	tV tR
# )WhichDBTestCasec                v   V P                  \        \        R \        P                  4       \        P
                  ! \        4      p\        \        P                  ! \        4      V\        P                  ! V4      .p\        4        EF	  pVP                  p\        4        V\        n        VP                  \        R4      ;_uu_ 4        RRR4       V F-  pV P                  W@P                  P                  V4      4       K/  	  VP                  \        R4      ;_uu_ 4       pRVR&   V P                  RV4       V P                  VR,          R4       RRR4       V F-  pV P                  W@P                  P                  V4      4       K/  	  EK  	  R#   + '       g   i     L; i  + '       g   i     L]; i)rk   r!   Nw   1)r   r   r	   rk   r   ru   r(   r   ry   r   r   r   r   r9   whichdbrm   )r,   _bytes_fnamefnamesr?   r   pathr#   s   &      r   test_whichdbWhichDBTestCase.test_whichdb   s-   mS__E{{6*),,V4	 2 2< @B"nF ??D$COVS)))  xx'7'7'=>  VS))Q$dA&  4$/ *   xx'7'7'=> # % *) *)s   F"1F(F%(F8zTest requires ndbm)reasonc                   \        \        R ,           R4      ;_uu_ 4       pVP                  R4       RRR4       \        P                  ! \        4      p\        \
        P                  ! \        4      V\
        P                  ! V4      .pV F-  pV P                  V P                  P                  V4      4       K/  	  R#   + '       g   i     L; i)z.dbwbs   spamN)
r   r(   writer   ru   r   ry   ra   r	   r   )r,   r#   r   r   r   s   &    r   test_whichdb_ndbm!WhichDBTestCase.test_whichdb_ndbm   s     &5.$''1GGG ({{6*),,V4	 2 2< @BDdhh..t45  ('s   B??C	zTest requires dbm.sqlite3c                    \         P                  ! \        R 4      ;_uu_ 4       pRVR&   RRR4       V P                  V P                  P                  \        4      R4       R#   + '       g   i     LA; i)r!   valuerM   Ndbm.sqlite3)dbm_sqlite3r   r(   r9   r	   r   )r,   dbs   & r   test_whichdb_sqlite3$WhichDBTestCase.test_whichdb_sqlite3   sO     fc**bBuI +))&1=A +*s   A##A3	c                   \         P                  ! R 4      p VP                  \        4      ;_uu_ 4       pVP	                  R4       VP                  4        RRR4       XP                  4        V P                  V P                  P                  \        4      R4       R#   + '       g   i     LQ; i  XP                  4        i ; i)r   zCREATE TABLE dummy(database)Nr   )
r   import_moduleconnectr(   executecommitr+   r9   r	   r   )r,   r   cxs   &  r    test_whichdb_sqlite3_existing_db0WhichDBTestCase.test_whichdb_sqlite3_existing_db   s      --i8	((B

9:		 ) HHJ))&1=A )( HHJs"   B3 "B B3  B0	+B3 3Cc                z    V P                  \        4       \        4        \        P                  ! R 4      V n        R# )r	   N)r   r   r   r   import_fresh_moduler	   rB   s   &r   r   WhichDBTestCase.setUp   s'    )* 44U;r   )r	   N)r   r   r   r   r   unittest
skipUnlessr   r   r   r   r   r   r   r   r   s   @r   r   r      s     ?2 &:;6 <6 -HIB JB -HI
B J
B< <r   r   :   NN	TestCase_r?   __main__)__doc__r   r	   r   test.supportr   r   r   r   r   r   TESTFNr   r   joinr(   r   r   r   r   TestCaser   r   r   suffixtestnametypeglobalsmainr   r   r   <module>r      s   C  
 	 & "*
 

	gy//	0

I IX=<h'' =<@ >C\\"F6(#Hx .0A0AB (#0GIh	  zMMO q  K  Ds"   C% C4 %	C10C14	D ?D 