%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/twisted/test/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/twisted/test/__pycache__/test_task.cpython-312.pyc |
� Ϫ�f� � � � d Z ddlmZmZmZmZmZ ddlmZ ddl m Z ddlmZ ej Z ddlmZ G d� dej � Z G d � d e� Z G d� dej( � Z G d � dej( � Z G d� dej( � Z G d� dej( � Z G d� d� Z G d� dej4 � Z G d� dej4 � Zy)z% Tests for L{twisted.internet.task}. � )�defer�error� interfaces�reactor�task)�installReactor)� NoReactor)�unittest)�failurec � � � e Zd Z� fd�Z� xZS )�TestableLoopingCallc �2 �� t �| � |i |�� || _ y �N)�super�__init__�clock)�selfr �a�kw� __class__s ��8/usr/lib/python3/dist-packages/twisted/test/test_task.pyr zTestableLoopingCall.__init__ s �� � ���!�"�r�"��� � )�__name__� __module__�__qualname__r � __classcell__)r s @r r r s �� �� r r c � � e Zd Zy)� TestExceptionN�r r r � r r r r s � �r r c �j � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Zy)� ClockTestsz< Test the non-wallclock based clock implementation. c �l � t j � }| j |j � d� y)zV Test that the C{seconds} method of the fake clock returns fake time. r N)r �Clock�assertEqual�seconds�r �cs r �testSecondszClockTests.testSeconds# s% � � �J�J�L���������a�(r c �2 � t j � }|j dd� dd�� }| j t j j |� � | j |j � d� | j |j � � y)z{ Test that calls can be scheduled for later with the fake clock and hands back an L{IDelayedCall}. � c � � y r r �r �bs r �<lambda>z*ClockTests.testCallLater.<locals>.<lambda>0 � � r � �r. N) r r$ � callLater� assertTruer �IDelayedCall� providedByr% �getTime�active�r r( �calls r � testCallLaterzClockTests.testCallLater* sk � � �J�J�L���{�{�1�/��a�{�8����� �/�/�:�:�4�@�A���������+������� �&r c � � t j � }|j dd� dd�� }|j � | j |j � � y)z3 Test that calls can be cancelled. r+ c � � y r r r- s r r/ z3ClockTests.testCallLaterCancelled.<locals>.<lambda>: r0 r r1 r2 N)r r$ r3 �cancel�assertFalser8 r9 s r �testCallLaterCancelledz!ClockTests.testCallLaterCancelled5 sC � � �J�J�L���{�{�1�/��a�{�8����� ��������'r c � � t j � }|j dd� dd�� }|j dd� dd�� }| j ||u � y ) z[ Test that the DelayedCall returned is not one previously created. � c � � y r r r- s r r/ z3ClockTests.test_callLaterOrdering.<locals>.<lambda>D r0 r r+ r1 r2 c � � y r r r- s r r/ z3ClockTests.test_callLaterOrdering.<locals>.<lambda>E r0 r � � N)r r$ r3 r? )r r( �call1�call2s r �test_callLaterOrderingz!ClockTests.test_callLaterOrdering>