Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/trial/test/__pycache__/test_pyunitcompat.cpython-39.pyc
Ðазад
a k�h� � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dl m Z mZ d dlm Z mZ G dd� de�ZG d d � d e�ZdS )� N)�skipIf)�implementer)�Failure)� IReporter� ITestCase)�PyUnitResultAdapter�SynchronousTestCasec @ s. e Zd ZG dd� dej�Zdd� Zdd� ZdS )�PyUnitTestTestsc @ s e Zd Zdd� ZdS )zPyUnitTestTests.PyUnitTestc C s d S �N� ��selfr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/trial/test/test_pyunitcompat.py� test_pass s z$PyUnitTestTests.PyUnitTest.test_passN)�__name__� __module__�__qualname__r r r r r � PyUnitTest s r c C s | � d�| _t| j�| _d S )Nr )r �originalr �testr r r r �setUp s zPyUnitTestTests.setUpc C s | � t| j�| j�d�� dS )zW Tests must be callable in order to be used with Python's unittest.py. z is not callable.N)� assertTrue�callabler r r r r � test_callable s zPyUnitTestTests.test_callableN)r r r �pyunitZTestCaser r r r r r r r s r c @ sp e Zd ZdZG dd� de�Zdd� Zdd� Zdd � Zd d� Z dd � Z dd� Zdd� Zdd� Z dd� Zdd� ZdS )�PyUnitResultTestsz� Tests to show that PyUnitResultAdapter wraps TestResult objects from the standard library 'unittest' module in such a way as to make them usable and useful from Trial. c @ s e Zd ZdZdZdd� ZdS )zPyUnitResultTests.ErrorTestz� A test case which has a L{test_foo} which will raise an error. @ivar ran: boolean indicating whether L{test_foo} has been run. Fc C s d| _ dd dS )zR Set C{self.ran} to True and raise a C{ZeroDivisionError} T� r N��ranr r r r �test_foo3 s z$PyUnitResultTests.ErrorTest.test_fooN)r r r �__doc__r r r r r r � ErrorTest* s r! c C sF t t�G dd� d��}| �d�}|� }|�|� | �|jd t� dS )z� The L{PyUnitResultAdapter} is only used when the result passed to C{run} does *not* provide L{IReporter}. c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )zXPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporterz� A reporter which records data about calls made to it. @ivar errors: Errors passed to L{addError}. @ivar failures: Failures passed to L{addFailure}. c S s g | _ g | _d S r )�errors�failuresr r r r �__init__I s zaPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.__init__c S s dS �z- Do nothing. Nr �r r r r r � startTestM s zbPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.startTestc S s dS r% r r&