Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_pipes.cpython-39.pyc

a

��g3�@s�ddlZddlZddlZddlZddlZddlmZmZmZej	dkrPe�
d��edZdejej
fZGdd�dej�Zd	d
�Zedkr�e��dS)�N)�TESTFN�unlink�
reap_children�posixz pipes module only works on posix�2ztr %s %sc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �SimplePipeTestscCsttfD]}t|�qdS�N)r�TESTFN2r)�self�f�r�+/usr/local/lib/python3.9/test/test_pipes.py�tearDownszSimplePipeTests.tearDowncCs�t�d�dur|�d�t��}|�ttj�|�t	d��}|�
d�Wd�n1sZ0Ytt	�� }|�|��d�Wd�n1s�0YdS)N�tr�tr is not available�wzhello world #1zHELLO WORLD #1)
�shutil�which�skipTest�pipes�Template�append�	s_command�STDIN_STDOUT�openr�write�assertEqual�read)r
�trrrr
�testSimplePipe1s
(
zSimplePipeTests.testSimplePipe1cCs�t�d�dur|�d�ttd��}|�d�Wd�n1sB0Yt��}|�t	dtj
�|�tt�tt�� }|�
|��d�Wd�n1s�0YdS)Nrrr�hello world #2z
 < $IN > $OUT�HELLO WORLD #2)rrrrrrrrrr�FILEIN_FILEOUT�copyr	rr�r
rrrrr
�testSimplePipe2s
(
zSimplePipeTests.testSimplePipe2cCs�t�d�dur|�d�ttd��}|�d�Wd�n1sB0Yt��}|�t	dtj
�|�td�}z|�|��d�W|�
�n
|�
�0dS)Nrrrr z < $IN�rr!)rrrrrrrrrr�
FILEIN_STDOUTrr�closer$rrr
�testSimplePipe3*s
(zSimplePipeTests.testSimplePipe3cCs�d}ttd��}|�|�Wd�n1s.0Yttd��}|�d�Wd�n1sb0Yt��}|�tt�tt�� }|�|��|�Wd�n1s�0YdS)Nzempty pipeline test COPYr�)	rrrr	rrr#rr�r
�drrrrr
�testEmptyPipeline17s((
z"SimplePipeTests.testEmptyPipeline1cCsxd}ttd��}|�|�Wd�n1s.0Yt��}|�td�}z|�|��|�W|��n
|��0dS)Nzempty pipeline test READrr&)rrrrrrrr(r+rrr
�testEmptyPipeline2Cs(z"SimplePipeTests.testEmptyPipeline2cCs~d}t��}|�td��}|�|�Wd�n1s80Ytt�� }|�|��|�Wd�n1sp0YdS)Nzempty pipeline test WRITEr)rrrrrrr)r
r,rrrrr
�testEmptyPipeline3Os(
z"SimplePipeTests.testEmptyPipeline3cCs:t��}|�t|�d�|�dtj�|�t|�d�dS)Nz<Template instance, steps=[]>�
tr a-z A-Zz1<Template instance, steps=[('tr a-z A-Z', '--')]>)rrr�reprrr�r
rrrr
�testReprXs
�zSimplePipeTests.testReprcCs<t��}|�d�|�|jd�|�d�|�|jd�dS)NFT)rr�debugr�	debuggingr2rrr
�testSetDebug_s


zSimplePipeTests.testSetDebugcCs,t��}|�dtj�|�t|jdd�dS)N�boguscmd�	bogusfiler&)rrr�SINK�assertRaises�
ValueErrorrr2rrr
�testReadOpenSinkfsz SimplePipeTests.testReadOpenSinkcCs,t��}|�dtj�|�t|jdd�dS)Nr7r8r)rr�prepend�SOURCEr:r;rr2rrr
�testWriteOpenSourcemsz#SimplePipeTests.testWriteOpenSourcecCs�t��}|�t|jdtj�|�t|jdd�|�t|jdtj�t��}|�dtj�|�t|jdtj�t��}|�t|jdtj	�t��}|�t|jdtj
�t��}|�t|jdtj	�t��}|�t|jdtj�dS)N�r7�xx�
boguscmd $OUT�boguscmd $IN)rrr:�	TypeErrorrrr;r>r9r"r'�
STDIN_FILEOUTr2rrr
�testBadAppendOptionsts.����z$SimplePipeTests.testBadAppendOptionscCs�t��}|�t|jdtj�|�t|jdd�|�t|jdtj�t��}|�dtj�|�t|jdtj�t��}|�t|jdtj	�t��}|�t|jdtj
�t��}|�t|jdtj	�t��}|�t|jdtj�dS)Nr@r0rAr7rBrC)rrr:rDr=rr;r9r>r"r'rEr2rrr
�testBadPrependOptions�s.����z%SimplePipeTests.testBadPrependOptionscCst��}|�t|jdd�dS)Nr8�x)rrr:r;rr2rrr
�testBadOpenMode�szSimplePipeTests.testBadOpenModecCsnt��}|�dtj�|��}|�t|�t|��|�|j|j�|�t|j�t|j��|�|j	|j	�dS)Nr0)
rrrrZcloneZassertNotEqual�idrZstepsr5)r
r�urrr
�	testClone�szSimplePipeTests.testCloneN)�__name__�
__module__�__qualname__rrr%r)r-r.r/r3r6r<r?rFrGrIrLrrrr
rs

	"!rcCs
t�dSr)rrrrr
�tearDownModule�srP�__main__)r�os�stringZunittestrZtest.supportrrr�nameZSkipTestr	�ascii_lowercase�ascii_uppercaserZTestCaserrPrM�mainrrrr
�<module>s

7

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists