Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/twisted/test/__pycache__/ |
Upload File : |
o 5�@g�z � @ s0 d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl m Z ddlmZ ddl mZmZ ddlmZ d d � ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� deed�ZG dd� de�ZG dd� de�Zdd� ZG dd� de�ZG dd� de�ZG dd� de�ZG d d!� d!e�ZdS )"z6 Test cases for the L{twisted.python.failure} module. � N)�StringIO��FrameSummary)�skipIf)�raiser)�failure�reflect)�SynchronousTestCasec O s4 zdd W |S t y tj| i |��}Y |S w )z� Make a C{Failure} of a divide-by-zero error. @param args: Any C{*args} are passed to Failure's constructor. @param kwargs: Any C{**kwargs} are passed to Failure's constructor. � r )� BaseExceptionr �Failure)�args�kwargs�f� r �B/usr/lib/python3/dist-packages/twisted/test/ignore_test_failure.py�getDivisionFailure s ��r c @ s e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dBdd�ZdCdd�ZdCdd�Z dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zd7d8� Zd9d:� Zd;d<� Z d=d>� Z!d?d@� Z"dAS )D�FailureTestsz' Tests for L{failure.Failure}. c C sN zt d�� ty t�� }Y nw |�tt�}| �|t� | �|jt � dS )z( Trapping a L{Failure}. �testN) �NotImplementedErrorr r r �trap� SystemExit�RuntimeError�assertEqual�type)�selfr �errorr r r �test_failAndTrap+ s �zFailureTests.test_failAndTrapc C sF t � }z|� ty t�� }Y nw | �t |jt�}| �||� dS )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 � untrappedr r r �test_trapRaisesWrappedException7 s �z,FailureTests.test_trapRaisesWrappedExceptionc C s, t � }t�|�}t�|�}| �|j|� dS )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 r r r! �value�r r"