shell bypass 403
o
`bN) � @ s| d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ G dd� dej �Z
G dd� dej �Zedkr<e�
� dS dS ) � N)�support)� os_helperc @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� ZdS )�FileCompareTestCasec C s� t j| _t jd | _t jd | _d}| j| j| jfD ]}t|ddd��
}|�|� W d � n1 s3w Y qt| jddd��
}|�d� W d � n1 sQw Y t�� | _ d S ) Nz-samez-diff�Contents of file go here.
�w�utf-8��encodingza+zAn extra line.
)
r ZTESTFN�name� name_same� name_diff�open�write�tempfile�
gettempdir�dir)�self�datar
�output� r �:/usr/local/python-3.10/lib/python3.10/test/test_filecmp.py�setUp s ���zFileCompareTestCase.setUpc C s( t �| j� t �| j� t �| j� d S �N)�os�unlinkr
r r �r r r r �tearDown s zFileCompareTestCase.tearDownc C sl | � t�| j| j�d� | � tj| j| jdd�d� | � t�| j| j�d� | � tj| j| jdd�d� d S )NzComparing file to itself failsF��shallowz&Comparing file to identical file fails)�
assertTrue�filecmp�cmpr
r r r r r �
test_matching s ����z!FileCompareTestCase.test_matchingc C s4 | � t�| j| j�d� | � t�| j| j�d� d S )Nz!Mismatched files compare as equalz#File and directory compare as equal)�assertFalser r! r
r r r r r r �test_different( s ��z"FileCompareTestCase.test_differentc C sJ t j| j| jdd�}t j| j| jdd�}t �� | �tt j�dkd� d S )NFr r z+Cache not cleared after calling clear_cache) r r! r
r r �clear_cacher �len�_cache)r Z
first_compareZsecond_comparer r r �test_cache_clear. s �z$FileCompareTestCase.test_cache_clearN)�__name__�
__module__�__qualname__r r r"