Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_popen.cpython-35.opt-1.pyc



��Yf��@s�dZddlZddlmZddlZddlZejZdekr]dedZGdd�dej�Z	e
dkr�ej�dS)	zQBasic tests for os.popen()

  Particularly useful for platforms that fake popen.
�N)�support� �"c@sXeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�	PopenTestc
Csed}|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�4/opt/alt/python35/lib64/python3.5/test/test_popen.py�_do_test_commandlineszPopenTest._do_test_commandlinecCsi|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_popencCss|jtjd�j�d�tjdkrP|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
Cs3tjd��}|j|j�d�WdQRXdS)Nz
echo hellozhello
)rr	rr
)r
�frrr�test_contextmanager4szPopenTest.test_contextmanagerc
Cs6tjd�� }|jt|�dg�WdQRXdS)Nz
echo hellozhello
)rr	r�list)r
rrrr�test_iterating8szPopenTest.test_iteratingc	Cs*tjdddddd��WdQRXdS)Nrzexit 0�mode�w�	bufferingr���)rr	)r
rrr�
test_keywords<szPopenTest.test_keywordsN)	�__name__�
__module__�__qualname__rrrrrr$rrrrrsr�__main__)�__doc__ZunittestZtestrr�sys�
executablerZTestCaserr%�mainrrrr�<module>s	-