Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/test/__pycache__/test_popen.cpython-36.opt-2.pyc

3

��2a��@sdddlZddlmZddlZddlZejZdekr>dedZGdd�dej�Ze	dkr`ej
�dS)�N)�support� �"c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�	PopenTestc
CsNd}|t|f}tj|��}|j�}WdQRXt|�dd�}|j||�dS)Nz&%s -c "import sys; print(sys.argv)" %s�)�python�os�popen�read�eval�assertEqual)�selfZcmdlineZexpected�cmd�p�dataZgot�r�//opt/alt/python36/lib64/python3.6/test_popen.py�_do_test_commandlineszPopenTest._do_test_commandlinecCsN|jttj�|jdddg�|jddddg�|jddddg�tj�dS)	Nzfoo barZfooZbarz foo "spam and eggs" "silly walk"z
spam and eggsz
silly walkzfoo "a \"quoted\" arg" barza "quoted" arg)ZassertRaises�	TypeErrorrr	rrZ
reap_children)r
rrr�
test_popens
zPopenTest.test_popencCsR|jtjd�j�d�tjdkr8|jtjd�j�d�n|jtjd�j�d�dS)Nzexit 0�ntzexit 42�*�i*)rrr	�close�name)r
rrr�test_return_code-s
zPopenTest.test_return_codec
Cs*tjd��}|j|j�d�WdQRXdS)Nz
echo hellozhello
)rr	rr
)r
�frrr�test_contextmanager4szPopenTest.test_contextmanagerc
Cs,tjd��}|jt|�dg�WdQRXdS)Nz
echo hellozhello
)rr	r�list)r
rrrr�test_iterating8szPopenTest.test_iteratingc	Cs tjdddd��WdQRXdS)Nzexit 0�wr)r�mode�	buffering���)rr	)r
rrr�
test_keywords<szPopenTest.test_keywordsN)	�__name__�
__module__�__qualname__rrrrrr$rrrrrsr�__main__)ZunittestZtestrr�sys�
executablerZTestCaserr%�mainrrrr�<module>s-