Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.14.143.76
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_resource.pyc
�
���cc@s�ddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZmZddl	m
Z
ddlmZddlmZmZd	d d
��YZdeejfd��YZd
ee
jejfd��YZejejd!kd�dejfd��Y�Zdejfd��YZde
jejfd��YZde
jejfd��YZdejfd��YZej ejddkd�dejfd��Y�Z!e"dkr�ej#�ndS("i����N(tPathi(tdata01(t	zipdata01t	zipdata02(tutil(t
import_module(t
import_helpertunlinkt
ResourceTestscBs,eZd�Zd�Zd�Zd�ZRS(cCs |jtj|jd��dS(Nsbinary.file(t
assertTruet	resourcestis_resourcetdata(tself((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_is_resource_good_pathscCs |jtj|jd��dS(Ns
not-a-file(tassertFalseR
RR(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_is_resource_missingscCs |jtj|jd��dS(Ntsubdirectory(RR
RR(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt&test_is_resource_subresource_directoryscCsbttj|j��}|jd�|jd�|jd�|j|dddddh�dS(	Nt__pycache__s__init__.pycs__init__.pyos__init__.pyRs
utf-8.filesbinary.filesutf-16.file(tsetR
tcontentsRtdiscardtassertEqual(R
R((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt
test_contentss


	(t__name__t
__module__RRRR(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyRs			tResourceDiskTestscBseZd�ZRS(cCs
t|_dS(N(RR(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pytsetUp1s(RRR(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR0stResourceZipTestscBseZRS((RR(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR5sisNo ResourceReader in Python 2tResourceLoaderTestscBs,eZd�Zd�Zd�Zd�ZRS(c	CsVtjdtdtjddddg�}|jttj|��dddh�dS(NtfiletpathRtAtBtC(Rtcreate_packageRt__file__RRR
R(R
tpackage((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_resource_contents;s
	!cCsMtjdtdtjddddddg�}|jtj|d��dS(	NRR RR!R"R#sD/EsD/F(RR$RR%R	R
R(R
R&((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_resource_is_resourceBs	cCsMtjdtdtjddddddg�}|jtj|d	��dS(
NRR RR!R"R#sD/EsD/FtD(RR$RR%RR
R(R
R&((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt'test_resource_directory_is_not_resourceHs	cCsMtjdtdtjddddddg�}|jtj|d	��dS(
NRR RR!R"R#sD/EsD/FtZ(RR$RR%RR
R(R
R&((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt%test_resource_missing_is_not_resourceNs	(RRR'R(R*R,(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR9s			tResourceCornerCaseTestscBseZd�ZRS(c	Cs�tjdtdtjddddg�}t�|_d|_tjd	kro|j|j_	|j|j_
n|jtj
|d��dS(
NRR RR!R"R#s/path/which/shall/not/be/namedi(i(RR$RR%tobjectt
__loader__tsystversion_infot__spec__tloadertoriginRR
R(R
tmodule((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt#test_package_has_no_reader_fallbackVs	!	(RRR6(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR-UstResourceFromZipsTest01cBs2eZeZd�Zd�Zd�Zd�ZRS(cCs)td�}|jtj|d��dS(Nsziptestdata.subdirectorysbinary.file(RR	R
R(R
t	submodule((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_is_submodule_resourcejscCs|jtjdd��dS(Nsziptestdata.subdirectorysbinary.file(R	R
R(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt$test_read_submodule_resource_by_nameoscCs5td�}|jttj|��ddh�dS(Nsziptestdata.subdirectorys__init__.pysbinary.file(RRRR
R(R
R8((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_submodule_contentssscCs)|jttjd��ddh�dS(Nsziptestdata.subdirectorys__init__.pysbinary.file(RRR
R(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_submodule_contents_by_nameys(RRRt
ZIP_MODULER9R:R;R<(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR7gs
			tResourceFromZipsTest02cBseZeZd�ZRS(cCsN|jttjd��ddh�|jttjd��ddh�dS(s�
        Test thata zip with two unrelated subpackages return
        distinct resources. Ref python/importlib_resources#44.
        sziptestdata.ones__init__.pys
resource1.txtsziptestdata.twos
resource2.txtN(RRR
R(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_unrelated_contents�s
(RRRR=R?(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR>stDeletingZipsTestcBsteZdZeZd�Zd�Zd�Zd�Zd�Z	e
jd�d��Zd�Z
d	�Zd
�ZRS(s^Having accessed resources in a zip file should not keep an open
    reference to the zip.
    cCs�tj�}|jtj|�t|jj�}|j}|d|_tdj	t
j���j�|_
|j
j|jj��tjjt|j
��td�|_dS(Nsziptestdata.zips{}.ziptziptestdata(Rt
modules_setupt
addCleanuptmodules_cleanupRR=R%tparenttsource_zip_pathtformattuuidtuuid4tabsolutetzip_pathtwrite_bytest
read_bytesR0R tappendtstrRR(R
tmodulest	data_pathtdata_dir((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR�s	
$cCs�ytjjt|j��Wntk
r0nXy'tjt|j�=tj|jj	=Wnt
k
rknXyt|j�Wntk
r�nXdS(N(
R0R tremoveRORKt
ValueErrortpath_importer_cacheRPRRtKeyErrorRtOSError(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttearDown�s


cCs#tjd�}|jj�~dS(NRA(R
RRKR(R
tc((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt test_contents_does_not_keep_open�s
cCs&tjdd�}|jj�~dS(NRAsbinary.file(R
RRKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt#test_is_resource_does_not_keep_open�s
cCs&tjdd�}|jj�~dS(NRAsnot-present(R
RRKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt+test_is_resource_failure_does_not_keep_open�s
sDesired but not supported.cCs&tjdd�}|jj�~dS(NRAsbinary.file(R
R RKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyttest_path_does_not_keep_open�s
cCs,tjdd�j�}|jj�~dS(NRAsbinary.file(R
R t	__enter__RKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt$test_entered_path_does_not_keep_open�s
cCs&tjdd�}|jj�~dS(NRAsbinary.file(R
tread_binaryRKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt#test_read_binary_does_not_keep_open�s
cCs,tjdddd�}|jj�~dS(NRAs
utf-8.filetencodingsutf-8(R
t	read_textRKR(R
RY((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt!test_read_text_does_not_keep_open�s
(RRt__doc__RR=RRXRZR[R\tunittesttskipR]R_RaRd(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR@�s							is,namespace packages not available on Python 2tResourceFromNamespaceTest01cBs;eZed��Zd�Zd�Zd�Zd�ZRS(cCs/tjjtjjtjjtd���dS(Ns..(R0R RNtostabspathtjoinR%(tcls((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt
setUpClass�scCs#|jtjtd�d��dS(Ntnamespacedata01sbinary.file(R	R
RR(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR9�scCs|jtjdd��dS(NRnsbinary.file(R	R
R(R
((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR:�scCs]ttjtd���}y|jd�Wntk
r?nX|j|dddh�dS(NRnRsbinary.files
utf-8.filesutf-16.file(RR
RRRSRVR(R
R((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR;�s
cCsWttjd��}y|jd�Wntk
r9nX|j|dddh�dS(NRnRsbinary.files
utf-8.filesutf-16.file(RR
RRSRVR(R
R((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyR<�s
(RRtclassmethodRmR9R:R;R<(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyRh�s
				t__main__((i($tos.pathRiR0Rftimportlib_resourcesR
RHtimportlib_resources._compatRtRRRRt	importlibRt_compatRRRtTestCaseRtZipSetupRtskipIfR1RR-tZipSetupBaseR7R>R@t
skipUnlessRhRtmain(((sK/usr/lib/python2.7/site-packages/importlib_resources/tests/test_resource.pyt<module>s2 "K	!
© 2025 GrazzMean