Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/__pycache__/test_zipimport.cpython-33.pyc

�
��fDc@s�ddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
mZmZddl
mZmZmZmZddlZddlZddlZddlZddlZddlmZmZmZdZdd�Zd	d
�Zej�Zeeeee��Z dZ!dZ"d
Z#ej$j%d�Z&ej'e!d�Z(e)rdndZ*Gdd�de
�Z+ej,Gdd�de+��Z-Gdd�dej.�Z/dd�Z0e1dkr�e0�ndS(iN(usupport(uImportHooksBaseTestCaseutest_srcutest_co(uZipFileuZipInfou
ZIP_STOREDuZIP_DEFLATED(u
extract_tbu
extract_stackuprint_tbu def do_raise(): raise TypeError
cCs�tj|�}t|�td�kr[|dkrBt|�}q[tdt|��}ntj�tjdt|�|d@�|}|S(Ngi���lu<iil��l����(umarshaludumpsutypeuintuimpu	get_magicustructupack(ucoumtimeusizeudataupyc((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyumake_pycs-umake_pyccCs|jtjd�S(Nu.(ureplaceuosusep(upath((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyumodule_path_to_dotted_name!sumodule_path_to_dotted_nameu
ziptestmoduleuziptestpackageuziptestpackage2u
junk95142.zipu.pyu.pycu.pyocBs�|EeZdZeZdd�Zdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Ze j!e"j#d:kd7�d8d9��Z%d:S(;uUncompressedZipImportTestCasecCs(tj�tjj�tj|�dS(N(u	linecacheu
clearcacheu	zipimportu_zip_directory_cacheuclearuImportHooksBaseTestCaseusetUp(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyusetUp5s

u#UncompressedZipImportTestCase.setUpcOs�ttd�}zvxT|j�D]F\}\}}t|tj|��}	|j|	_|j|	|�qW|j	�|j
dd�}
|
dk	r�ttd��}|j
�}WdQXttd��!}|j|
�|j|�WdQXntjjdt�tdj|�t�t�dg�}|j
d�}
|
dk	rL|
|�n|r�|j�}|j|tjjt|�|�nWd|j	�tjt�XdS(	Nuwustuffurbuwbiu.u	__dummy__ucall(uZipFileuTEMP_ZIPuitemsuZipInfoutimeu	localtimeucompressionu
compress_typeuwritestrucloseugetuNoneuopenureaduwriteusysupathuinsertu
__import__ujoinuglobalsulocalsuget_fileuassertEqualuosuremove(uselfuexpected_extufilesumodulesukwuzunameumtimeudatauzinfoustuffufumoducallufile((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyudoTest<s4



u$UncompressedZipImportTestCase.doTestcCs�dtjkr|jd�ndtjkr;tjd=nittfd6}y|jd|d�Wn1tk
r�|jt	kr�|j
d�nYn X|jtkr�|j
d�ndS(Nuzlibuzlib is a builtin moduleuzlib.pyu.pyu&expected test to not raise ImportErroru"expected test to raise ImportError(usysubuiltin_module_namesuskipTestumodulesuNOWutest_srcudoTestuImportErrorucompressionuZIP_DEFLATEDufailu
ZIP_STORED(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testAFakeZlib_s

u+UncompressedZipImportTestCase.testAFakeZlibcCs.ittftd6}|jd|t�dS(Nu.py(uNOWutest_srcuTESTMODudoTest(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestPysu$UncompressedZipImportTestCase.testPycCs.ittftt6}|jt|t�dS(N(uNOWutest_pycuTESTMODupyc_extudoTest(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestPyc�su%UncompressedZipImportTestCase.testPyccCs?ittftd6ttftt6}|jt|t�dS(Nu.py(uNOWutest_srcuTESTMODutest_pycupyc_extudoTest(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestBoth�su&UncompressedZipImportTestCase.testBothcCs.itdftd6}|jd|t�dS(Nuu.py(uNOWuTESTMODudoTestuNone(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestEmptyPy�su)UncompressedZipImportTestCase.testEmptyPycCsYtt�}|ddN<ittftd6t|ftt6}|jd|t�dS(Niiu.py(u	bytearrayutest_pycuNOWutest_srcuTESTMODupyc_extudoTest(uselfubadmagic_pycufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestBadMagic�s
u*UncompressedZipImportTestCase.testBadMagiccCsntt�}|ddN<it|ftt6}y|jd|t�Wntk
r\YnX|jd�dS(Niiu.pyu)expected ImportError; import from bad pyc(u	bytearrayutest_pycuNOWuTESTMODupyc_extudoTestuImportErrorufail(uselfubadmagic_pycufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testBadMagic2�s
u+UncompressedZipImportTestCase.testBadMagic2cCsYtt�}|ddN<ittftd6t|ftt6}|jd|t�dS(Niiu.py(u	bytearrayutest_pycuNOWutest_srcuTESTMODupyc_extudoTest(uselfubadtime_pycufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestBadMTime�s
u*UncompressedZipImportTestCase.testBadMTimecCsWttj}ittf|dt6ttf|tt6}|jt|tt�dS(Nu__init__(uTESTPACKuosusepuNOWutest_pycupyc_extuTESTMODudoTest(uselfupackdirufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestPackage�s
u)UncompressedZipImportTestCase.testPackagecCs�ttj}|ttj}ittf|dt6ttf|dt6ttf|tt6}|jt|ttt�dS(Nu__init__(	uTESTPACKuosusepu	TESTPACK2uNOWutest_pycupyc_extuTESTMODudoTest(uselfupackdirupackdir2ufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestDeepPackage�s
u-UncompressedZipImportTestCase.testDeepPackagecCs�ttj}|ttj}ittf|dt6ttf|dt6ttf|tt6}tt	d�}zZxT|j
�D]F\}\}}t|tj
|��}|j|_|j||�q�W|j�tjt	�}	|j|	jt	�|j|	jt�d�|	jt�}
|j|	jt�|
j�tt�jd}tjjt	t�}|j||�|j|	j|d�d�|j|	j|t�d�|j|	j|t�d�|t}
t |
�}t|�t!j"|}
|j|	j#t�d�|j|	j#|
�d�|j|	j|
�|
j�|
j%}|j|j#|�d�|j|j|�|
j�tjt	tjt�}|j|jt	�|j|j&ttj�Wd|j�tj't	�XdS(Nu__init__uwiTF((uTESTPACKuosusepu	TESTPACK2uNOWutest_pycupyc_extuTESTMODuZipFileuTEMP_ZIPuitemsuZipInfoutimeu	localtimeucompressionu
compress_typeuwritestrucloseu	zipimportuzipimporteruassertEqualuarchiveu
is_packageuTrueuload_moduleuget_filenameu__file__u
__import__u__path__upathujoinuFalseumodule_path_to_dotted_nameusysumodulesu
get_sourceuNoneu
__loader__uprefixuremove(uselfupackdirupackdir2ufilesuzunameumtimeudatauzinfouziumoduexisting_pack_pathuexpected_path_pathumod_pathumod_nameuloaderuzi2((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestZipImporterMethods�sL




	
u4UncompressedZipImportTestCase.testZipImporterMethodscCsmttj}|ttj}ittf|dt6ttf|tt6}tt	d�}z�xT|j
�D]F\}\}}t|tj
|��}|j|_|j||�qmW|j�tjt	tj|�}	|j|	jt	�|j|	j|�|j|	jt�d�|	jt�}
|j|	jt�|
j�|j|	jttjd�d�|j|	jttjt�d�ttjt}t|�}t|�tj |}
|j|	j!t�d�|j|	j!|�d�|j|	j|�|
j�|
j#}
|j|
j!|�d�|j|
j|�|
j�Wd|j�tj$t	�XdS(Nu__init__uwTF(%uTESTPACKuosusepu	TESTPACK2uNOWutest_pycupyc_extuTESTMODuZipFileuTEMP_ZIPuitemsuZipInfoutimeu	localtimeucompressionu
compress_typeuwritestrucloseu	zipimportuzipimporteruassertEqualuarchiveuprefixu
is_packageuTrueuload_moduleuget_filenameu__file__uFalseumodule_path_to_dotted_nameu
__import__usysumodulesu
get_sourceuNoneu
__loader__uremove(uselfupackdirupackdir2ufilesuzunameumtimeudatauzinfouziumodumod_pathumod_nameuloader((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu$testZipImporterMethodsInSubDirectory�sB



	 
uBUncompressedZipImportTestCase.testZipImporterMethodsInSubDirectorycCs�ttd�}|j|_z�d}tdd�td�D��}|j||�|j�tjt�}|j	||j
|��|jdt|��Wd|j�t
jt�XdS(Nuwutestdata.datcss|]}|VqdS(N((u.0ux((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu	<genexpr>su<UncompressedZipImportTestCase.testGetData.<locals>.<genexpr>iuzipimporter object(uZipFileuTEMP_ZIPucompressionubytesurangeuwritestrucloseu	zipimportuzipimporteruassertEqualuget_datauassertInurepruosuremove(uselfuzunameudatauzi((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestGetDatas

u)UncompressedZipImportTestCase.testGetDatacCsed}tt|dd�tt|��}it|ftt6tdfd6}|jt|t�dS(Nu�if 1:  # indent hack
        def get_file():
            return __file__
        if __loader__.get_data("some.data") != b"some data":
            raise AssertionError("bad data")
u<???>uexecu	some datau	some.data(umake_pycucompileuNOWulenuTESTMODupyc_extudoTest(uselfusrcupycufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestImporterAttr&s
$u.UncompressedZipImportTestCase.testImporterAttrcCs8ittftd6}|jd|tddd�dS(Nu.pyustuffs
Some Stuffi(uNOWutest_srcuTESTMODudoTest(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestImport_WithStuff1su2UncompressedZipImportTestCase.testImport_WithStuffcCs|jtj|�t�dS(N(uassertEqualuinspectu	getsourceutest_src(uselfumodule((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyuassertModuleSource8su0UncompressedZipImportTestCase.assertModuleSourcecCs7ittftd6}|jd|td|j�dS(Nu.pyucall(uNOWutest_srcuTESTMODudoTestuassertModuleSource(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testGetSource;su+UncompressedZipImportTestCase.testGetSourcecCsltttdd�ttt��}ittftd6t|ftt6}|jt|td|j�dS(Nu<???>uexecu.pyucall(	umake_pycucompileutest_srcuNOWulenuTESTMODupyc_extudoTestuassertModuleSource(uselfupycufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestGetCompiledSource?s$u3UncompressedZipImportTestCase.testGetCompiledSourcecCsAittftd6tdfd6}|jd|td|�dS(Nu.pyu>>> log.append(True)
uxyz.txtucall(uNOWutest_srcuTESTMODudoTest(uselfucallbackufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
runDoctestEsu(UncompressedZipImportTestCase.runDoctestcCscg}tjd}t_z&tjdd|dddt��Wd|t_X|j|dg�dS(Nuxyz.txtupackageumodule_relativeuglobsT(udoctestumasteruNoneutestfileuTrueulocalsuassertEqual(uselfumoduleulogu
old_master((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
doDoctestFileJs
u+UncompressedZipImportTestCase.doDoctestFilecCs|j|j�dS(N(u
runDoctestu
doDoctestFile(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestDoctestFileVsu-UncompressedZipImportTestCase.testDoctestFilecCsEg}tjdd|dddt��j�|j|dg�dS(Nuxyz.txtupackageumodule_relativeuglobsT(udoctestuDocFileTestuTrueulocalsurunuassertEqual(uselfumoduleulog((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyudoDoctestSuiteYs
u,UncompressedZipImportTestCase.doDoctestSuitecCs|j|j�dS(N(u
runDoctestudoDoctestSuite(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestDoctestSuiteasu.UncompressedZipImportTestCase.testDoctestSuitec
Cs�y|j�Wn�tj�dj}t|d�d\}}}}|j|tj��t|j	d�d\}}}}|j|tj��t
j�}t|d|�|j
|j�jt��Yn
Xtd��dS(NiiiuThis ought to be impossible(udo_raiseusysuexc_infoutb_nextu
extract_tbuassertEqualu	raise_srcustripu
extract_stackutb_frameuiouStringIOuprint_tbu
assertTrueugetvalueuendswithuAssertionError(uselfumoduleutbufulnounulineus((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyudoTracebackds"!u)UncompressedZipImportTestCase.doTracebackcCs7ittftd6}|jd|td|j�dS(Nu.pyucall(uNOWu	raise_srcuTESTMODudoTestuNoneudoTraceback(uselfufiles((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testTracebackvsu+UncompressedZipImportTestCase.testTracebackuneed an unencodable filenamecCs�tjd}t|d�}ttdtjt��}|j|_	|j
|t�|j�zt
j|�Wdtj|�XdS(Nu.zipuwu.py(usupportuTESTFN_UNENCODABLEuZipFileuZipInfouTESTMODutimeu	localtimeuNOWucompressionu
compress_typeuwritestrutest_srcucloseu	zipimportuzipimporteruosuremove(uselfufilenameuzuzinfo((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestUnencodablezs

u-UncompressedZipImportTestCase.testUnencodableN(&u__name__u
__module__u__qualname__u
ZIP_STOREDucompressionusetUpudoTestu
testAFakeZlibutestPyutestPycutestBothutestEmptyPyutestBadMagicu
testBadMagic2utestBadMTimeutestPackageutestDeepPackageutestZipImporterMethodsu$testZipImporterMethodsInSubDirectoryutestGetDatautestImporterAttrutestImport_WithStuffuassertModuleSourceu
testGetSourceutestGetCompiledSourceu
runDoctestu
doDoctestFileutestDoctestFileudoDoctestSuiteutestDoctestSuiteudoTracebacku
testTracebackuunittestuskipIfusupportuTESTFN_UNENCODABLEuNoneutestUnencodable(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyuUncompressedZipImportTestCase1s<# 	2*uUncompressedZipImportTestCasecBs|EeZdZeZdS(uCompressedZipImportTestCaseN(u__name__u
__module__u__qualname__uZIP_DEFLATEDucompression(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyuCompressedZipImportTestCase�suCompressedZipImportTestCasecBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS(uBadFileZipImportTestCasecCs|jtjtj|�dS(N(uassertRaisesu	zipimportuZipImportErroruzipimporter(uselfufilename((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyuassertZipFailure�su)BadFileZipImportTestCase.assertZipFailurecCs|jd�dS(NuAdfjdkFJKDFJjdklfjs(uassertZipFailure(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testNoFile�su#BadFileZipImportTestCase.testNoFilecCs|jd�dS(Nu(uassertZipFailure(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestEmptyFilename�su*BadFileZipImportTestCase.testEmptyFilenamecCs6|jttjd�|jttjtdd�dS(Nukwd(uassertRaisesu	TypeErroru	zipimportuzipimporteruNoneuTESTMOD(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestBadArgs�su$BadFileZipImportTestCase.testBadArgscCs|jdd�dS(NuAi�(uassertZipFailure(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestFilenameTooLong�su,BadFileZipImportTestCase.testFilenameTooLongcCs+tjt�tjt�|jt�dS(N(usupportuunlinkuTESTMODucreate_empty_fileuassertZipFailure(uself((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu
testEmptyFile�s

u&BadFileZipImportTestCase.testEmptyFilecCshtjt�tjttjd�}ztj|�|jt�Wdtjtd�tjt�XdS(Nii�(	usupportuunlinkuTESTMODuosuopenuO_CREATucloseuassertZipFailureuchmod(uselfufd((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestFileUnreadable�s

u+BadFileZipImportTestCase.testFileUnreadablecCsHtjt�ttd�}|jdd�|j�|jt�dS(Nuw+uai(usupportuunlinkuTESTMODuopenuwriteucloseuassertZipFailure(uselfufp((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyutestNotZipFile�s


u'BadFileZipImportTestCase.testNotZipFilec
Cs�tjt�ttd�}|jtjdd��|jd�|j�tj	t�}z|j
t|jd�|j
t|jd�|j
t|jd�|j
t|jd�|j
t|jd�|j
t|jd�tj}|j|jd�d�|j
||jd�|j
||jd�|j
t|jd�|j
||jd�|j
||jd�Wdtjj�XdS(Nuw+u=IiPKuaiuabcuaaaaaaaaaaaaaaaaaa(usupportuunlinkuTESTMODuopenuwriteustructupackucloseu	zipimportuzipimporteruassertRaisesu	TypeErrorufind_moduleuNoneuload_moduleu
is_packageuget_codeuget_datau
get_sourceuZipImportErroruassertEqualuIOErroru_zip_directory_cacheuclear(uselfufpuzuerror((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu_testBogusZipFile�s*


	u*BadFileZipImportTestCase._testBogusZipFileN(u__name__u
__module__u__qualname__uassertZipFailureu
testNoFileutestEmptyFilenameutestBadArgsutestFilenameTooLongu
testEmptyFileutestFileUnreadableutestNotZipFileu_testBogusZipFile(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyuBadFileZipImportTestCase�suBadFileZipImportTestCasecCs,ztjttt�Wdtjt�XdS(N(usupporturun_unittestuUncompressedZipImportTestCaseuCompressedZipImportTestCaseuBadFileZipImportTestCaseuunlinkuTESTMOD(((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu	test_main�su	test_mainu__main__(2usysuosumarshaluimpustructutimeuunittestutestusupportutest.test_importhooksuImportHooksBaseTestCaseutest_srcutest_couzipfileuZipFileuZipInfou
ZIP_STOREDuZIP_DEFLATEDu	zipimportu	linecacheudoctestuinspectuiou	tracebacku
extract_tbu
extract_stackuprint_tbu	raise_srcumake_pycumodule_path_to_dotted_nameuNOWulenutest_pycuTESTMODuTESTPACKu	TESTPACK2upathuabspathuTEMP_ZIPucache_from_sourceupyc_fileu	__debug__upyc_extuUncompressedZipImportTestCaseu
requires_zlibuCompressedZipImportTestCaseuTestCaseuBadFileZipImportTestCaseu	test_mainu__name__(((u8/opt/alt/python33/lib64/python3.3/test/test_zipimport.pyu<module>sD"�YG