File: //lib/python3/dist-packages/twisted/trial/test/__pycache__/test_assertions.cpython-38.pyc
U
W[&� � @ sj d Z ddlmZmZ ddlZddlZddlmZ ddl m
Z
mZmZ ddl
mZ ddlmZmZ ddlmZ dd lmZ dd
lmZmZmZ G dd� dee�ZG d
d� de�ZG dd� dej�ZG dd� dej�ZG dd� dej�Z G dd� dej�Z!G dd� dej�Z"G dd� dej�Z#G dd� dej�Z$G dd� dej�Z%ee%j&�dd � �Z'ee%j&d!d"�d#d$� �Z(dS )%a�
Tests for assertions provided by C{SynchronousTestCase} and C{TestCase},
provided by L{twisted.trial.unittest}.
L{TestFailureTests} demonstrates that L{SynchronousTestCase.fail} works, so that
is the only method on C{twisted.trial.unittest.SynchronousTestCase} that is
initially assumed to work. The test classes are arranged so that the methods
demonstrated to work earlier in the file are used by those later in the file
(even though the runner will probably not run the tests in this order).
� )�division�absolute_importN)�FancyEqMixin)�prefixedMethods�accumulateMethods�fullyQualifiedName��
deprecated)�Version�getVersionString)�Failure)�unittest)�Deferred�fail�succeedc @ s e Zd ZdZdd� Zdd� ZdS )�MockEquality��namec C s
|| _ d S �Nr )�selfr � r �D/usr/lib/python3/dist-packages/twisted/trial/test/test_assertions.py�__init__ s zMockEquality.__init__c C s d| j f S )NzMockEquality(%s)r �r r r r �__repr__$ s zMockEquality.__repr__N)�__name__�
__module__�__qualname__ZcompareAttributesr r r r r r r s r c @ s e Zd ZdZdd� Ze ZZdS )�ComparisonErrorzH
An object which raises exceptions from its comparison methods.
c C s t d��d S )NzComparison is broken)�
ValueError)r �otherr r r �_error, s zComparisonError._errorN)r r r �__doc__r! �__eq__�__ne__r r r r r ( s r c @ s: e Zd ZdZG dd� dej�Zdd� Zdd� Zdd � Z d
S )�TestFailureTestsa�
Tests for the most basic functionality of L{SynchronousTestCase}, for
failing tests.
This class contains tests to demonstrate that L{SynchronousTestCase.fail}
can be used to fail a test, and that that failure is reflected in the test
result object. This should be sufficient functionality so that further
tests can be built on L{SynchronousTestCase} instead of
L{unittest.TestCase}. This depends on L{unittest.TestCase} working.
c @ s e Zd Zdd� ZdS )zTestFailureTests.FailingTestc C s | � d� d S )NzThis test fails.�r r r r r �
test_fails? s z'TestFailureTests.FailingTest.test_failsN)r r r r'