Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.10/lib2to3/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.10/lib2to3/tests/__pycache__/test_main.cpython-310.pyc
o

�9jl�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ej�ej�
e�d�Zej�ed�ZGdd�dej�ZedkrOe�
�dSdS)�N)�main�datazpy2_test_grammar.pyc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�TestMaincCs
d|_dS�N)�temp_dir��self�r	�./usr/lib/python3.10/lib2to3/tests/test_main.py�setUps
zTestMain.setUpcCs(tjjdd�=|jrt�|j�dSdSr)�logging�root�handlersr�shutil�rmtreerr	r	r
�tearDowns�zTestMain.tearDowncCsZtj}tj}tj}|t_|t_|t_zt�d|�W|t_|t_|t_S|t_|t_|t_w)Nz
lib2to3.fixes)�sys�stdin�stdout�stderrr)r�args�
in_capture�out_capture�err_capture�
save_stdin�save_stdout�save_stderrr	r	r
�run_2to3_captures�zTestMain.run_2to3_capturecCstt�d�}t��}t�d�|�}t��}|�dg|||�}|�|d�|���d�}|�	d|�|�	d|���dS)Nuprint 'nothing'
print u'über'
�ascii�-rz-print 'nothing'z9WARNING: couldn't encode <stdin>'s diff for your terminal)
�io�StringIO�BytesIO�codecs�	getwriterr�assertEqual�getvalue�decode�assertIn)r�input_stream�out�out_enc�err�ret�outputr	r	r
�test_unencodable_diff,s
�zTestMain.test_unencodable_diffcCs�t��|_tj�|jd�|_tj�|jd�|_t�|j�t�|j�g|_	t
tj�|jd�d���|j	�d�t
�t|j�|j	�tj�t��tj�|jd�|_tj�|jd�|_t
|jd��
}|�d�Wd�n1srwY|j	�d�dS)z5Setup a test source tree and output destination tree.�python2_project�python3_projectz__init__.py�wz
trivial.pyz#print 'I need a simple conversion.'N)�tempfile�mkdtempr�os�path�join�py2_src_dir�py3_dest_dir�mkdir�setup_files�open�close�appendr�copy�PY2_TEST_MODULE�basename�trivial_py2_file�
init_py2_file�write)r�trivialr	r	r
�setup_test_source_trees8s 
�z TestMain.setup_test_source_treesc
s|��t��}t��}d�|�dd�ddd|j|jgt�d�||�}|�|d�|��}|�d	|�|�d
|j|jf|�|�t	�fdd�|j
D��t	t�|j���|j
D]}|�d
tj
�|j|�tj
�|j|��f|�qXt�tj�}|�|d�d|��|�|d�d|��dS)z92to3 a single directory with a new output dir and suffix.�TEST�-nz--add-suffix�--write-unchanged-files�
--no-diffs�--output-dir�rz implies -w.�6Output in %r will mirror the input directory %r layoutc3s�|]}|�VqdSrr	��.0�name��suffixr	r
�	<genexpr>\s�zGTestMain.test_filename_changing_on_output_single_dir.<locals>.<genexpr>zWriting converted %s to %szNo changes to .*/__init__\.py�/zNo changes to .*/trivial\.pyN)rFr r!rr9r8r%r&r(�setr;r5�listdirr6r7�re�escape�sep�assertRegex�replace�assertNotRegex)rr*r,r-rrPrYr	rQr
�+test_filename_changing_on_output_single_dirKsJ�����
����z4TestMain.test_filename_changing_on_output_single_dircCs�|��t��}|j|jg}tdd�|D��}|�ddddd|jg|t�d�t��|�}|�|d	�|�	�}|�
d
|j|jf|�|�|tt�
|j���dS)z62to3 two files in one directory with a new output dir.css�|]	}tj�|�VqdSr)r5r6rArNr	r	r
rSms�zFTestMain.test_filename_changing_on_output_two_files.<locals>.<genexpr>rH�-wrIrJrKrLrrMN)rFr r!rBrCrUrr9r%r&r(r8r5rV)rr,�	py2_files�expected_filesr-rr	r	r
�*test_filename_changing_on_output_two_fileshs*�����z3TestMain.test_filename_changing_on_output_two_filescCs�|��t��}|�dddd|j|jgt�d�t��|�}|�|d�|��}|�d|j|j	f|�|�t
tj�
|j�g�t
t�|j���dS)	z)2to3 a single file with a new output dir.rHr^rJrKrLrrMN)rFr r!rr9rBr%r&r(r8rUr5r6rArV)rr,r-rr	r	r
�,test_filename_changing_on_output_single_fileys&�����z5TestMain.test_filename_changing_on_output_single_fileN)�__name__�
__module__�__qualname__rrrr/rFr]rarbr	r	r	r
rsr�__main__)r#r rr5rWrrr3�unittest�lib2to3rr6r7�dirname�__file__�
TEST_DATA_DIRr@�TestCaserrcr	r	r	r
�<module>s w�

Youez - 2016 - github.com/yon3zu
LinuXploit