+
    ÖÇÜh  ã                   óN   € ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt R tR t	R t
R tR# )é    N)Údownload)Úbuild_indexc                ób   € \        V P                  R4      4      p\        RV4      pVRJ g   Q hR# )zSTest that download works properly when the parent folder of the download_dir existsÚanother_dirÚmwa_ppdbTN©ÚstrÚjoinpathr   ©Útmp_pathÚdownload_dirÚdownload_statuss   &  Ú@/usr/lib/python3/dist-packages/nltk/test/unit/test_downloader.pyÚ2test_downloader_using_existing_parent_download_dirr   	   s3   € ô �x×(Ñ(¨Ó7Ó8€LÜ˜z¨<Ó8€OØ˜dÓ"Ð"Ò"ó    c                ód   € \        V P                  RR4      4      p\        RV4      pVRJ g   Q hR# )z[Test that download works properly when the parent folder of the download_dir does not existznon-existing-parent-folderzanother-non-existing-folderr   TNr   r   s   &  r   Ú6test_downloader_using_non_existing_parent_download_dirr      s<   € ô Ø×ÑÐ6Ð8UÓVó€Lô ˜z¨<Ó8€OØ˜dÓ"Ð"Ò"r   c           
     óÂ  € ^ p^p\        V P                  R4      4      p\        W^,           4       EF  p\        P                  P                  R4      ;_uu_ 4       p\        RV4      pVRJ g   Q hWA8X  dt   \        P                  P                  R\        P                  P                  RR4      ,          4      pVP                  ^,          P                  VP                  8X  g   Q hMSWB8X  dN   \        P                  P                  R4      pVP                  ^,          P                  VP                  8X  g   Q hR	R	R	4       EK  	  R	#   + '       g   i     EK-  ; i)
zOTest that a second download correctly triggers the 'already up-to-date' messageÚtest_repeat_downloadzbuiltins.printÚ	stopwordsTz[nltk_data]   Unzipping %s.Úcorporazstopwords.zipz6[nltk_data]   Package stopwords is already up-to-date!N)r	   r
   ÚrangeÚunittestÚmockÚpatchr   ÚcallÚosÚpathÚjoinÚcall_args_listÚargs)r   Úfirst_downloadÚsecond_downloadr   ÚiÚ
print_mockr   Úexpected_second_calls   &       r   Útest_downloader_redownloadr'      s  € ð €NØ€Oä�x×(Ñ(Ð)?Ó@ÓA€LÜ�>°QÕ#6×7ˆä�]‰]× Ñ Ð!1×2Ô2°jÜ& {°LÓAˆOØ" dÓ*Ð*Ð*ØÔ"Ü'/§}¡}×'9Ñ'9Ø1Ü—g‘g—l‘l 9¨oÓ>õ?ó(Ð$ð "×0Ñ0°Õ3×8Ñ8Ð<P×<UÑ<UÔUÐUÑUØÔ%Ü'/§}¡}×'9Ñ'9ØLó(Ð$ð "×0Ñ0°Õ3×8Ñ8Ð<P×<UÑ<UÔUÐUÐU÷ 3Ò2ó 8ç2×2Ñ2ús   ÁC!EÅEc                ó¼  € \        V P                  R4      4      pRp\        P                  P	                  W 4      p\        P
                  ! VRR7       \        P                  P	                  W2 R24      p\        VR4      ;_uu_ 4       pVP                  RV R24       R	R	R	4       \        P                  P	                  W2 4      p\        P                  ! VR
V\        P                  P                  V4      R7       \        \        P                  P                  V4      RR7      pV^ ,          ^ ,          pVP                  R4      R8X  g   Q hVP                  R4      p	\        V	\         4      '       g   Q h\        V	4      ^8”  g   Q hVP                  R4      p
\        V
\         4      '       g   Q h\        V
4      ^8”  g   Q hR	#   + '       g   i     EL2; i)z(Test building index with both checksums.ÚpackagesÚtest_packageT)Úexist_okz.xmlÚwz<package id="zF" name="A Test Package" webpage="http://www.somefake.url/" unzip="1"/>NÚzip)Ú	base_nameÚformatÚroot_dirÚbase_dirzhttps://someurl)ÚrootÚbase_urlÚidÚchecksumÚsha256_checksum)r	   r
   r   r   r   ÚmakedirsÚopenÚwriteÚshutilÚmake_archiveÚbasenamer   ÚdirnameÚgetÚ
isinstanceÚlen)r   Útest_pkg_dirÚtest_pkg_nameÚtest_pkg_pathÚtest_xml_pathÚfiÚzip_pathÚ	xml_indexÚpackage_elementÚmd5_checksumr6   s   &          r   Útest_build_indexrJ   4   s‰  € ô �x×(Ñ(¨Ó4Ó5€LØ"€MÜ—G‘G—L‘L °ÓB€MÜ‡K‚K�¨Õ-Ü—G‘G—L‘L °/ÀÐ0FÓG€MÜ	ˆm˜S×	!Ô	! RØ
�‰Ø˜M˜?ð +ð ô	
÷ 
"ô �w‰w�|‰|˜M¨_Ó>€HÜ
×ÒØØØÜ—‘×!Ñ! -Ó0õ	ô Ü�W‰W�_‰_˜\Ó*Ð5Fô€Ið   •l 1•o€OØ×Ñ˜tÓ$¨Ô6Ð6Ð6Ø"×&Ñ& zÓ2€LÜ�l¤C×(Ò(Ð(Ð(Üˆ|Ó˜qÔ Ð Ð Ø%×)Ñ)Ð*;Ó<€OÜ�o¤s×+Ò+Ð+Ð+ÜˆÓ !Ô#Ð#Ò#÷/ 
"×	!Ð	!ús   ÂG
Ç
G	)r   r:   Úunittest.mockr   Únltkr   Únltk.downloaderr   r   r   r'   rJ   © r   r   Ú<module>rO      s)   ðÛ 	Û Û å Ý 'ò#ò#òVô2$r   