%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/application/runner/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/application/runner/test/__pycache__/test_exit.cpython-312.pyc

�

Ϫ�f����dZddlmZddlmZmZddlZddlm	Z	ddl	m
Z
mZGd	�d
ejjj�ZGd�d�Zy)
z0
Tests for L{twisted.application.runner._exit}.
�)�StringIO)�Optional�UnionN�)�_exit�)�
ExitStatus�exitc�8�eZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zy)	�	ExitTestsz
    Tests for L{exit}.
    Nc�d�t�|_|jtd|j�y)N�sysexit)�	DummyExitr
�patchr��selfs �K/usr/lib/python3/dist-packages/twisted/application/runner/test/test_exit.py�setUpzExitTests.setUps���K��	��
�
�5�)�T�Y�Y�/�c�j�d}t|�|j|jj|�y)zR
        L{exit} given an L{int} status code will pass it to L{sys.exit}.
        i�N)r
�assertEqual�arg�r�statuss  r�test_exitStatusIntzExitTests.test_exitStatusInts(�����V�����������/rc��tj}t|�|j|jj|j
�y)zu
        L{exit} given a L{ValueConstant} status code passes the corresponding
        value to L{sys.exit}.
        N)r	�	EX_CONFIGr
rr�valuers  r�test_exitConstantzExitTests.test_exitConstant!s2��
�%�%���V�������������5rc��t�}|jtd|�d}td|�|j	|j�|dz�y)zq
        L{exit} given a status code of zero (C{0}) writes the given message to
        standard output.
        �stdout�
Hello, world.r�
N�rrrr
r�getvalue�r�out�messages   r�test_exitMessageZerozExitTests.test_exitMessageZero*sD��
�j���
�
�5�(�C�(�!���Q�����������4��8rc��t�}|jtd|�d}td|�|j	|j�|dz�y)zj
        L{exit} given a non-zero status code writes the given message to
        standard error.
        �stderrr"�@r#Nr$r&s   r�test_exitMessageNonZeroz!ExitTests.test_exitMessageNonZero7sD��
�j���
�
�5�(�C�(�!���R�����������4��8r��returnN)	�__name__�
__module__�__qualname__�__doc__rrrr)r-�rrrrs ���0�0�6�9�9rrc�:�eZdZdZdd�Zddeeeefddfd�Z	y)	rzv
    Stub for L{sys.exit} that remembers whether it's been called and, if it
    has, what argument it was given.
    r/Nc��d|_y)NF)�exitedrs r�__init__zDummyExit.__init__Ks	����rrc�<�|jrJ�||_d|_y)NT)r7r)rrs  r�__call__zDummyExit.__call__Ns���;�;��������rr.)N)
r0r1r2r3r8rr�int�strr:r4rrrrEs,���
��H�U�3��8�_�5���rr)r3�ior�typingrr�twisted.trial.unittest�twisted�runnerrr	r
�trial�unittest�TestCaserrr4rr�<module>rEsB����"���$�29��
�
�&�&�/�/�29�j
�
r

Zerion Mini Shell 1.0