%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/twisted/test/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/twisted/test/__pycache__/ignore_test_failure.cpython-312.pyc |
� Ϫ�f�� � � � d Z ddlmZ ddlZddlZddlZddlZddlZddlm Z ddl mZ ddlmZ ddl mZ ddlmZmZ dd lmZ dd lmZ ddlmZmZ ddlmZ d d�d&d�Z G d� de� Z G d� de� Z G d� de� Z G d� dee �� Z! G d� de� Z" G d� de� Z#d'd�Z$ G d� de� Z% G d � d!e� Z& G d"� d#e� Z' G d$� d%e� Z(y)(z6 Test cases for the L{twisted.python.failure} module. � )�annotationsN)�distb)�StringIO��FrameSummary)� TracebackType)�Any� Generator)�skipIf)�raiser)�failure�reflect)�SynchronousTestCaseF��captureVarsc �^ � ddz S # t $ r t j | �� }Y |S w xY w)z6 Make a C{Failure} of a divide-by-zero error. � r r )� BaseExceptionr �Failure)r �fs �B/usr/lib/python3/dist-packages/twisted/test/ignore_test_failure.py�getDivisionFailurer s9 � �5� �A�� �H�� � 5��O�O��4���H�5�s � �,�,c �" � e Zd ZdZd#d�Zd#d�Zd#d�Zd#d�Zd$d�Zd%d�Z d&d�Z d' d(d �Zd)d*d �Zd)d*d�Z d#d�Zd#d �Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd+d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Z d#d�Z!d#d �Z"d#d!�Z#y"),�FailureTestsz' Tests for L{failure.Failure}. c � � t d� �# t $ r t j � }Y nw xY w|j t t � }| j |t � | j |j t � y)z( Trapping a L{Failure}. �testN) �NotImplementedErrorr r r �trap� SystemExit�RuntimeError�assertEqual�type)�selfr �errors r �test_failAndTrapzFailureTests.test_failAndTrap+ sb � � "�%�f�-�-��� "����!�A� "�����z�<�0�������-�������!4�5s � �-�-c �� � t � } |�# t $ r t j � }Y nw xY w| j t |j t � }| j ||� y)z� If the wrapped C{Exception} is not a subclass of one of the expected types, L{failure.Failure.trap} raises the wrapped C{Exception}. N)� ValueErrorr r r �assertRaisesr � OverflowError�assertIs)r# � exceptionr � untrappeds r �test_trapRaisesWrappedExceptionz,FailureTests.test_trapRaisesWrappedException7 sX � � �L� � "��O��� "����!�A� "�� �%�%�j�!�&�&�-�H� �� � �i��+s � �.�.c � � t � }t j |� }t j |� }| j |j |� y)z� A L{failure.Failure} constructed from another L{failure.Failure} instance, has its C{value} property set to the value of that L{failure.Failure} instance. N)r'