+
    Bi              
       >   R t ^ RIt^ RIHt ^ RIHt ^ RIt ^ RIt]! ]P                  P                  R^R7      ^ ,          4      t^RIHt ^RIHtHtHt ^RIHtHt ]! ]! ]4      P0                  R	,          R
,          4      tRtRtRRRRRR/tRRRRRRRRRR/t]P=                  4       t]PA                  ]4       ]PB                  R 4       t"R t#R t$R t%]PL                  PO                  R ](! ]PS                  4       4      ](! ]PU                  4       4      R!7      R" 4       t+]PL                  PO                  R ](! ]PS                  4       4      ](! ]PU                  4       4      R!7      R# 4       t,]PL                  PO                  R ](! ]PS                  4       4      ](! ]PU                  4       4      R!7      R$ 4       t-R% t.]PL                  PO                  R ](! ]PS                  4       4      ](! ]PU                  4       4      R!7      R& 4       t/R#   ] d	    Rt^ t ELi ; i)'z3
Test the hash calculation and checking functions.
N)Path)NamedTemporaryFile.)maxsplit)Pooch)make_registry	file_hashhash_matches)check_tiny_datamirror_directorydatastorezOtiny-data.txt baee0894dba14b12085eacb204284b97e362f4f3e5a5807693cc90ef415c1b2d
zsubdir/tiny-data.txt baee0894dba14b12085eacb204284b97e362f4f3e5a5807693cc90ef415c1b2d
tiny-data.txt baee0894dba14b12085eacb204284b97e362f4f3e5a5807693cc90ef415c1b2d
sha1(c03148994acd89317915ea2f2d080d6dd127aa09sha256@baee0894dba14b12085eacb204284b97e362f4f3e5a5807693cc90ef415c1b2dmd5 70e2afd3fd7e336ae478b1e740a5f08exxh64f843815fe57948faxxh3298d6f1a2xxh128 0267d220db258fffb0c567c0ecd1b689xxh3_128xxh3_64811e3f2a12aec53fc                "    \        \        V 4      # )z
Mirror the test data folder on a temporary directory. Needed to avoid
permission errors when pooch is installed on a non-writable path.
)r   DATA_DIR)tmp_paths   &U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pooch/tests/test_hashes.pydata_dir_mirrorr!   :   s     Hh//    c                f   \        RR7      pVP                  4         \        WP                  RR7       \	        VP                  RR7      ;_uu_ 4       pVP                  4       pRRR4       X\        8X  g   Q h\        V R/ R7      pVP                  VP                  4       \        V R	,          4      pVP                  R	4      pWV8X  g   Q h\        V4       \        P                  ! VP                  4       R#   + '       g   i     L; i  \        P                  ! TP                  4       i ; i)
zGCheck that the registry builder creates the right file names and hashesFdelete	recursiveutf-8encodingNsome bogus URLpathbase_urlregistrytiny-data.txt)r   closer   nameopenreadREGISTRYr   load_registrystrfetchr
   osremove)r!   outfilefoutr/   puptruefnames   &      r    test_make_registryr@   C   s     .GMMO o||uE',,11Tyy{H 28###3CbQ',,'?_45		/*}}
		',, 21 			',,s$   6D C;%A4D ;D	D "D0c                   \        RR7      pVP                  4         \        WP                  RR7       \	        VP                  RR7      ;_uu_ 4       pVP                  4       pRRR4       X\        8X  g   Q h\        V R/ R	7      pVP                  VP                  4       \        V R
,          4      VP                  R
4      8X  g   Q h\        VP                  R
4      4       \        V R,          R
,          4      pWTP                  R4      8X  g   Q h\        VP                  R4      4       \        P                  ! VP                  4       R#   + '       g   i     L; i  \        P                  ! TP                  4       i ; i)z7Check that the registry builder works in recursive modeFr$   Tr&   r(   r)   Nr+   r,   r0   subdirzsubdir/tiny-data.txt)r   r1   r   r2   r3   r4   REGISTRY_RECURSIVEr   r6   r7   r8   r
   r9   r:   )r!   r;   r<   r/   r=   r>   s   &     r    test_make_registry_recursiverD   X   s    .GMMO o||tD',,11Tyy{H 2----3CbQ',,'?_45?9SSSS		/23?X-?@yy!78888		"89:
		',, 21 			',,s$   6E$ E%C
E$ E!	E$ $"Fc                     \         P                  ! \        4      ;_uu_ 4       p \        RRR7       RRR4       R\	        X P
                  4      9   g   Q hR#   + '       g   i     L.; i)z!Test an invalid hashing algorithm	somethingblah)r?   algNz'blah')pytestraises
ValueErrorr   r7   value)excs    r     test_file_hash_invalid_algorithmrN   n   sA    	z	"	"c0 
#s399~%%% 
#	"s   AA'	zalg,expected_hash)idsc                D   V P                  R4      '       dG   \        f   \        P                  ! R4       V R9  d"   \        ^8  d   \        P                  ! R4       \
        P                  P                  \        R4      p\        V4       \        W 4      pW18X  g   Q hR# )z2Test the hash calculation using hashlib and xxhashxxhNrequires xxhashrequires xxhash > 2.0r0   r   r   )
startswithxxhashrI   skipXXHASH_MAJOR_VERSIONr9   r-   joinr   r
   r   )rH   expected_hashr?   returned_hashs   &&  r    test_file_hashr\   u   su     ~~e>KK)*((-AA-EKK/0GGLL?3EEe)M)))r"   c                   V P                  R4      '       dG   \        f   \        P                  ! R4       V R9  d"   \        ^8  d   \        P                  ! R4       \
        P                  P                  \        R4      p\        V4       V  RV 2p\        W#4      '       g   Q hV  R2p\        W#4      '       d   Q hR# )	z*Make sure the hash checking function worksrQ   NrR   rS   r0   ::blablablablarT   )rU   rV   rI   rW   rX   r9   r-   rY   r   r
   r	   )rH   rZ   r?   
known_hashs   &&  r    test_hash_matchesra      s     ~~e>KK)*((-AA-EKK/0GGLL?3EE5-)J****5&JE.....r"   c           	     F   \         P                  P                  \        R4      p\	        V4       V  RV 2p\        W#RR7      '       g   Q hV  R2p\        P                  ! \        4      ;_uu_ 4       p\        W$RRR7       RRR4       R\        XP                  4      9   g   Q h\        P                  ! \        4      ;_uu_ 4       p\        W$RRR7       RRR4       V\        VP                  4      9   g   Q hR#   + '       g   i     L; i  + '       g   i     LA; i)	zBMake sure the hash checking function raises an exception if strictr0   r^   Tstrictr_   	Neverlandrd   sourceN)r9   r-   rY   r   r
   r	   rI   rJ   rK   r7   rL   )rH   rZ   r?   r`   bad_hasherrors   &&    r    test_hash_matches_strictrj      s     GGLL?3EE5-)J$7777m$H	z	"	"eUT+F 
##ekk****	z	"	"eUT$? 
#C$$$$ 
#	" 
#	"s   3C=D=D	D 	c                     \         P                  P                  \        R4      p \	        V RR7      '       g   Q h\	        RRR7      '       g   Q h\	        V RRR7      '       g   Q hR# )zHThe hash checking function should always returns True if known_hash=Noner0   N)r`    )r?   r`   T)r`   rd   )r9   r-   rY   r   r	   )r?   s    r    test_hash_matches_nonerm      sQ    GGLL?3E$////bT2222$t<<<<r"   c           	        \         P                  P                  \        R4      p\	        V4       V  RVP                  4        2p\        W#RR7      '       g   Q h\        P                  ! \        4      ;_uu_ 4       p\        W#RR RRR7       RRR4       R\        XP                  4      9   g   Q hR#   + '       g   i     L.; i)	z:Hash matching should be independent of upper or lower caser0   r^   Trc   Nre   rf   )r9   r-   rY   r   r
   upperr	   rI   rJ   rK   r7   rL   )rH   rZ   r?   r`   ri   s   &&   r    test_hash_matches_uppercaserq      s     GGLL?3EE5---/01J$7777	z	"	"eUsODM 
##ekk**** 
#	"s   <B44C	)0__doc__r9   pathlibr   tempfiler   rI   rV   intVERSIONsplitrX   ImportErrorcorer   hashesr   r   r	   utilsr
   r   r7   __file__parentr   r5   rC   TINY_DATA_HASHES_HASHLIBTINY_DATA_HASHES_XXHcopyTINY_DATA_HASHESupdatefixturer!   r@   rD   rN   markparametrizelistitemskeysr\   ra   rj   rm   rq    r"   r    <module>r      sq   
  ' v~~33C!3DQGH
  
 5tH~$$v-78V 	W 
 6P	-  Z02!  ,002    , - 0 0 * ,& 				!"""$%  

*

* 				!"""$%  
/
/" 	!	'	'	)*%**,-  
%
%"= 	!	'	'	)*%**,-  

+

+[  Fs   .H HH