Your IP : 216.73.216.85


Current Path : /opt/alt/python38/lib64/python3.8/test/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/test/__pycache__/test_popen.cpython-38.pyc

U

i�f��@shdZddlZddlmZddlZddlZejZdekrBdedZGdd�dej�Z	e
dkrde��dS)	zQBasic tests for os.popen()

  Particularly useful for platforms that fake popen.
�N)�support� �"c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�	PopenTestc	CsNd}|t|f}t�|��}|��}W5QRXt|�dd�}|�||�dS)Nz&%s -c "import sys; print(sys.argv)" %s�)�python�os�popen�read�eval�assertEqual)�selfZcmdlineZexpected�cmd�p�dataZgot�r�4/opt/alt/python38/lib64/python3.8/test/test_popen.py�_do_test_commandlineszPopenTest._do_test_commandlinecCsN|�ttj�|�dddg�|�ddddg�|�ddddg�t��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|�t�d���d�tjdkr8|�t�d���d�n|�t�d���d�dS)N�exit 0�ntzexit 42�*i*)rrr	�close�namerrrr�test_return_code-s
zPopenTest.test_return_codec	Cs*t�d��}|�|��d�W5QRXdS�Nz
echo hellozhello
)rr	rr
�r
�frrr�test_contextmanager4szPopenTest.test_contextmanagerc	Cs,t�d��}|�t|�dg�W5QRXdSr)rr	r�listrrrr�test_iterating8szPopenTest.test_iteratingc	Cs tjdddd��W5QRXdS)Nr�w���)r�mode�	buffering)rr	rrrr�
test_keywords<szPopenTest.test_keywordsN)	�__name__�
__module__�__qualname__rrrr r"r'rrrrrsr�__main__)�__doc__ZunittestZtestrr�sys�
executablerZTestCaserr(�mainrrrr�<module>s-