Your IP : 216.73.216.60


Current Path : /opt/alt/python39/lib64/python3.9/test/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/__pycache__/test_popen.cpython-39.pyc

a

XC?h�@shdZddlZddlmZddlZddlZejZdevrBdedZGdd�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)�	PopenTestcCsbd}|t|f}t�|��}|��}Wd�n1s80Yt|�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/python39/lib64/python3.9/test/test_popen.py�_do_test_commandlines&zPopenTest._do_test_commandlinecCsJ|�ttj�|�dddg�|�dgd��|�dgd��t��dS)Nzfoo bar�foo�barz foo "spam and eggs" "silly walk")rz
spam and eggsz
silly walkzfoo "a \"quoted\" arg" bar)rza "quoted" argr)ZassertRaises�	TypeErrorrr	rrZ
reap_children�r
rrr�
test_popens���zPopenTest.test_popencCsR|�t�d���d�t�d���}tjdkr<|�|d�n|�t�|�d�dS)N�exit 0zexit 42�nt�*)rrr	�close�name�waitstatus_to_exitcode)r
Zstatusrrr�test_return_code-s

zPopenTest.test_return_codecCs>t�d�� }|�|��d�Wd�n1s00YdS�Nz
echo hellozhello
)rr	rr
�r
�frrr�test_contextmanager5szPopenTest.test_contextmanagercCs@t�d��"}|�t|�dg�Wd�n1s20YdSr )rr	r�listr!rrr�test_iterating9szPopenTest.test_iteratingcCs4tjdddd��Wd�n1s&0YdS)Nr�w���)r�mode�	buffering)rr	rrrr�
test_keywords=szPopenTest.test_keywordsN)	�__name__�
__module__�__qualname__rrrr#r%r*rrrrrsr�__main__)�__doc__Zunittest�testrr�sys�
executablerZTestCaserr+�mainrrrr�<module>s.