%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f�	��^�dZddlZddlmZddlmZddlmZGd�dej�Z	y)zL
Tests for async assertions provided by C{twisted.trial.unittest.TestCase}.
�N)�defer)�failure)�unittestc�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)	�AsynchronousAssertionsTestszp
    Tests for L{TestCase}'s asynchronous extensions to L{SynchronousTestCase}.
    That is, assertFailure.
    c�Z�tjd��}|j|t�S)Nc��ddzS�N�r�r��I/usr/lib/python3/dist-packages/twisted/trial/test/test_asyncassertions.py�<lambda>z@AsynchronousAssertionsTests.test_assertFailure.<locals>.<lambda>�
���A��r
)r�
maybeDeferred�
assertFailure�ZeroDivisionError��self�ds  r�test_assertFailurez.AsynchronousAssertionsTests.test_assertFailures&�����
�.���!�!�!�%6�7�7r
c���tjd��}�j|t�|j	�fd��fd��|S)Nc��ddzSr
rrr
rrzOAsynchronousAssertionsTests.test_assertFailure_wrongException.<locals>.<lambda>rr
c�&���jd�S�NzShould have failed��fail��xrs �rrzOAsynchronousAssertionsTests.test_assertFailure_wrongException.<locals>.<lambda>����d�i�i� 4�5�r
c�:��|j�j�S�N��trap�failureExceptionrs �rrzOAsynchronousAssertionsTests.test_assertFailure_wrongException.<locals>.<lambda>����a�f�f�T�2�2�3�r
)rrr�
OverflowError�addCallbacksrs` r�!test_assertFailure_wrongExceptionz=AsynchronousAssertionsTests.test_assertFailure_wrongExceptions<������
�.�����1�m�,�	���5�3�	
��r
c���tjd�}�j|t�|j	�fd��fd��|S)Nc�&���jd�Srrrs �rrzLAsynchronousAssertionsTests.test_assertFailure_noException.<locals>.<lambda>'r r
c�:��|j�j�Sr"r#rs �rrzLAsynchronousAssertionsTests.test_assertFailure_noException.<locals>.<lambda>(r&r
)r�succeedrrr(rs` r�test_assertFailure_noExceptionz:AsynchronousAssertionsTests.test_assertFailure_noException#s;����M�M�$������1�/�0�	���5�3�	
��r
c���	ddz|jt�}|j|j�|S#t$r,tj�}tj|�}Y�hwxYw)z�
        In the case of assertFailure failing, check that we get lots of
        information about the exception that was raised.
        rr)	rr�Failurerrr�RuntimeError�
addErrback�
_checkInfo)r�frs   r�test_assertFailure_moreInfoz7AsynchronousAssertionsTests.test_assertFailure_moreInfo,sc��
	�
��E�
���q�,�/��	���T�_�_�a�(����!�	����!�A��
�
�1�
�A�	�s�;�2A0�/A0c���|j|j�sJ�|j�}|j|j�|�|j|j	�|�yr")�checkr%�getErrorMessage�assertIn�getBriefTraceback)r�assertionFailurer4�outputs    rr3z&AsynchronousAssertionsTests._checkInfo:sX���%�%�d�&;�&;�<�<�<�!�1�1�3���
�
�a�'�'�)�6�2��
�
�a�)�)�+�V�4r
c���Gd�dt��G�fd�dtj�}|d�}tj�}|j|�|j
dt|j��y)zJ
        A single wrong assertFailure should fail the whole test.
        c��eZdZy)�MAsynchronousAssertionsTests.test_assertFailure_masked.<locals>.ExampleFailureN)�__name__�
__module__�__qualname__rr
r�ExampleFailurer?Es��r
rCc���eZdZW�Zd�Zy)�AAsynchronousAssertionsTests.test_assertFailure_masked.<locals>.TCc��tjd��}|j|t�|j|t�|S)Nc��ddzSr
rrr
rrzfAsynchronousAssertionsTests.test_assertFailure_masked.<locals>.TC.test_assertFailure.<locals>.<lambda>Ls
���A��r
)rrrr'rrs  rrzTAsynchronousAssertionsTests.test_assertFailure_masked.<locals>.TC.test_assertFailureKs8���'�'�
�6���"�"�1�m�4��"�"�1�&7�8��r
N)r@rArBr%r)rCs�r�TCrEHs���-��
r
rHrrN)	�	Exceptionr�TestCase�pyunit�
TestResult�run�assertEqual�len�failures)rrH�test�resultrCs    @r�test_assertFailure_maskedz5AsynchronousAssertionsTests.test_assertFailure_masked@sa���
	�Y�	�	��"�"�	��&�'���"�"�$�����������C����0�1r
N)
r@rArB�__doc__rr)r.r5r3rSrr
rrrs%���
8����5�2r
r)
rTrrK�twisted.internetr�twisted.pythonr�
twisted.trialrJrrr
r�<module>rXs,���
�"�"�"�D2�(�"3�"3�D2r

Zerion Mini Shell 1.0