Your IP : 216.73.216.213


Current Path : /proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/test_popen.cpython-34.pyc

�
g f�@s�dZddlZddlmZddlZddlZejZdekr`dedZnGdd�dej�Z	dd	�Z
ed
kr�e
�ndS)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	Csdd}|t|f}tj|��}|j�}WdQXt|�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/python34/lib64/python3.4/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
Cs2tjd��}|j|j�d�WdQXdS)Nz
echo hellozhello
)rr	rr
)r
�frrr�test_contextmanager4szPopenTest.test_contextmanagerc
Cs5tjd�� }|jt|�dg�WdQXdS)Nz
echo hellozhello
)rr	r�list)r
rrrr�test_iterating8szPopenTest.test_iteratingcCs)tjdddddd��WdQXdS)Nrzexit 0�mode�w�	bufferingr���)rr	)r
rrr�
test_keywords<szPopenTest.test_keywordsN)	�__name__�
__module__�__qualname__rrrrrr$rrrrrsrcCstjt�dS)N)rZrun_unittestrrrrr�	test_main@sr(�__main__)�__doc__ZunittestZtestrr�sys�
executablerZTestCaserr(r%rrrr�<module>s	-