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 :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_filecmp.cpython-310.pyc
o

�9jN)�@s|ddlZddlZddlZddlZddlZddlmZddlmZGdd�dej	�Z
Gdd�dej	�Zedkr<e�
�dSdS)	�N)�support)�	os_helperc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�FileCompareTestCasec	Cs�tj|_tjd|_tjd|_d}|j|j|jfD]}t|ddd��
}|�|�Wd�n1s3wYqt|jddd��
}|�d�Wd�n1sQwYt��|_	dS)	Nz-samez-diff�Contents of file go here.
�w�utf-8��encodingza+zAn extra line.
)
r�TESTFN�name�	name_same�	name_diff�open�write�tempfile�
gettempdir�dir)�self�datar�output�r�(/usr/lib/python3.10/test/test_filecmp.py�setUps���zFileCompareTestCase.setUpcCs(t�|j�t�|j�t�|j�dS�N)�os�unlinkrrr
�rrrr�tearDownszFileCompareTestCase.tearDowncCsl|�t�|j|j�d�|�tj|j|jdd�d�|�t�|j|j�d�|�tj|j|jdd�d�dS)NzComparing file to itself failsF��shallowz&Comparing file to identical file fails)�
assertTrue�filecmp�cmprrrrrr�
test_matchings����z!FileCompareTestCase.test_matchingcCs4|�t�|j|j�d�|�t�|j|j�d�dS)Nz!Mismatched files compare as equalz#File and directory compare as equal)�assertFalser!r"rr
rrrrr�test_different(s��z"FileCompareTestCase.test_differentcCsJtj|j|jdd�}tj|j|jdd�}t��|�ttj�dkd�dS)NFrrz+Cache not cleared after calling clear_cache)	r!r"rrr
�clear_cacher �len�_cache)r�
first_compare�second_comparerrr�test_cache_clear.s�z$FileCompareTestCase.test_cache_clearN)�__name__�
__module__�__qualname__rrr#r%r+rrrrrs

rc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�DirCompareTestCasec	CsVt��}tj�|d�|_tj�|d�|_tj�|d�|_tj�|jd�|_tj�	d�tj�	d�k|_
d}|j|j|j|jfD]G}t�|d�t�
|�tj�|d	�}t�
|�|j
rb||jurbd
}nd}ttj�||�dd
d��
}|�|�Wd�n1s�wYq>ttj�|jd�dd
d��}|�d�Wd�dS1s�wYdS)Nrzdir-samezdir-diff�.hg�A�arT�subdir�FiLe�filerrr�file2zAn extra file.
)rrr�path�joinr�dir_same�dir_diff�dir_ignored�normcase�caseinsensitive�shutil�rmtree�mkdirrr)r�tmpdirrr�subdir_path�fnrrrrr6s,

��"�zDirCompareTestCase.setUpcCs$|j|j|jfD]}t�|�qdSr)rr9r:r>r?)rrrrrrQs�zDirCompareTestCase.tearDowncCs|�dtj�dS)Nr0)�assertInr!�DEFAULT_IGNORESrrrr�test_default_ignoresUsz'DirCompareTestCase.test_default_ignorescCs|�t�|j|jdg�dgggfkd�|�t�|j|jdg�dgggfkd�|�tj|j|jdgdd�dgggfkd�|�tj|j|jdgdd�d�ttj�|jd�ddd	��
}|�	d
�Wd�n1skwY|�
t�|j|jddg�dgdggfkd�dS)Nr5z#Comparing directory to itself failsz!Comparing directory to same failsFrr6rrr�Different contents.
z&Comparing mismatched directories fails)r r!�cmpfilesrr9rrr7r8rr$)rrrrr�
test_cmpfilesXs@
��
���
��������z DirCompareTestCase.test_cmpfilescCs|�t|�t|��dS)z0Assert that two lists are equal, up to ordering.N)�assertEqual�sorted)r�actual�expectedrrr�
_assert_listsssz DirCompareTestCase._assert_listscCs�|j|j}}t�||�}|�|j|�|�|j|�|jr1|�|j	ddg�|�|j
ddg�n|�|j	ddg�|�|j
ddg�|�|jddg�|�|jdg�|�|j
g�|�|jg�|�|jdg�|�|jg�d�|j|j�ddg}|�|j|�|j|j}}t�||�}|�|j|�|�|j|�|�|j	ddg�|�|j
gd��|�|jddg�|�|jdg�|�|j
g�|�|jdg�|�|jdg�|�|jg�d�|j|j�d	�|j�ddg}|�|j|�|j|j}}t�tj�|jd�tj�|jd��t�||�}|�|j|�|�|j|�|�|j	gd��|�|j
ddg�|�|jddg�|�|j
dg�|�|jg�|�|jdg�|�|jg�d�|j|j�d	�|j�ddg}|�|j|�ttj�|jd�d
dd��
}|�d
�Wd�n	1�s�wYt�|j|j�}|�|jdg�|�|jdg�d�|j|j�dddg}|�|j|�dS)Nr5r3r4�
diff {} {}�Identical files : ['file']�"Common subdirectories : ['subdir'])r5r6r3r6zOnly in {} : ['file2']rrrrGzDiffering files : ['file2'])rr9r!�dircmprJ�left�rightr=rN�	left_list�
right_list�common�common_dirs�	left_only�
right_only�
same_files�
diff_files�format�_assert_report�reportr:r>�moverr7r8rr)r�left_dir�	right_dir�d�expected_reportrrrr�test_dircmpxs��
��
���zDirCompareTestCase.test_dircmpcCsXGdd�dtj�}||j|j�}|j}|�t|���dg�|d}|�t|�|�dS)z/Check that dircmp.subdirs respects subclassing.c@seZdZdS)z=DirCompareTestCase.test_dircmp_subdirs_type.<locals>.MyDirCmpN)r,r-r.rrrr�MyDirCmp�srfr3N)	r!rRrr:�subdirsrJ�list�keys�type)rrfrc�sub_dirs�sub_dcmprrr�test_dircmp_subdirs_type�sz+DirCompareTestCase.test_dircmp_subdirs_typecC�j|j|j}}t�||�}tj�|d�}tj�|d�}d�|j|j�dddd�||�g}|�|j	|�dS�Nr3rOrPrQ�)
rr9r!rRrr7r8r]r^�report_partial_closure�rrarbrc�left_subdir�right_subdirrdrrr�test_report_partial_closure��
�z.DirCompareTestCase.test_report_partial_closurecCrnro)
rr9r!rRrr7r8r]r^�report_full_closurerrrrr�test_report_full_closure�rvz+DirCompareTestCase.test_report_full_closurecCsRt���}|�|�����d�}|�||�Wd�dS1s"wYdS)N�
)r�captured_stdout�getvalue�strip�splitrJ)r�
dircmp_report�expected_report_lines�stdout�report_linesrrrr^�s

"�z!DirCompareTestCase._assert_reportN)
r,r-r.rrrFrIrNrermrurxr^rrrrr/5sT
r/�__main__)r!rr>r�unittest�testr�test.supportr�TestCaserr/r,�mainrrrr�<module>s*E�

Youez - 2016 - github.com/yon3zu
LinuXploit