Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/tap/tests/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/tap/tests/__pycache__/test_main.cpython-37.pyc

B

.��Vj�@s�ddlZddlZyddlmZWnek
r<ddlZYnXddlmZddlmZm	Z	m
Z
mZddlm
Z
Gdd�de
�ZdS)�N)�mock)�Loader)�build_suite�
get_status�main�
parse_args)�TestCasec@sxeZdZdZdd�Zdd�Zej�e	d�dd��Z
ej�e	d�d	d
��Ze�d�e�d�ej�ej
d
�dd����ZdS)�TestMainzTests for tap.maincCs0ddg}ttjd�}t||d�}|�d|�dS)zAThe main function returns an error status if there were failures.z	/bin/fakezfake.tap�w)�stream�N)�open�os�devnullr�assertEqual)�self�argvr�status�r�D/opt/alt/python37/lib/python3.7/site-packages/tap/tests/test_main.py�test_exits_with_errorszTestMain.test_exits_with_errorcCs$t��}d|j_|�dt|��dS)NTr)r�Mock�
wasSuccessful�return_valuerr)r�resultrrr�test_get_successful_statussz#TestMain.test_get_successful_status�load_suite_from_stdincCs4t��}g|_t��}||_t|�}|�||�dS)N)rr�filesrrr)rr�args�expected_suite�suiterrr�test_build_suite_from_stdin!sz$TestMain.test_build_suite_from_stdincCs6ddg}t|�}t��}||_t|�}|�||�dS)Nz	/bin/fake�-)rrrrrr)rrrrrr rrr� test_build_suite_from_stdin_dash*sz)TestMain.test_build_suite_from_stdin_dashztap.main.sys.stdinztap.main.sys.exit�
print_helpcCs8dg}tjdd�|_t|�|�|j�|�|j�dS)Nz	/bin/fakeT)r)rr�isattyr�
assertTrue�called)rr$Zsys_exitZ
mock_stdinrrrr�test_when_no_pipe_to_stdin3s
z#TestMain.test_when_no_pipe_to_stdinN)�__name__�
__module__�__qualname__�__doc__rrr�patch�objectrr!r#�argparse�ArgumentParserr(rrrrr	s			r	)r/r�unittestr�ImportErrorZ
tap.loaderrZtap.mainrrrrZ	tap.testsrr	rrrr�<module>s