%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/internet/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/internet/test/__pycache__/test_defer_await.cpython-312.pyc |
� Ϫ�f� � � � d Z ddlZddlmZ ddlmZmZmZmZm Z ddl mZ ddlm Z ddlmZ G d� d e� Z G d � de� Zy)z* Tests for C{await} support in Deferreds. � N)�NoReturn)�Deferred�ensureDeferred�fail� maybeDeferred�succeed)�Clock)�Failure)�TestCasec � � e Zd ZdZy)�SampleExceptionz2 A specific sample exception for testing. N)�__name__� __module__�__qualname__�__doc__� � �H/usr/lib/python3/dist-packages/twisted/internet/test/test_defer_await.pyr r s � �r r c �` � e Zd ZdZd d�Zd d�Zd d�Zd d�Zd d�Zd d�Z d d �Z d d �Zd d�Zd d�Z y)� AwaitTestsz@ Tests for using Deferreds in conjunction with PEP-492. Nc �n � t � }|j � }| j |t |� � y)z< C{Deferred.__await__} returns an iterable. N)r � __await__�assertEqual�iter)�self�d�awaitedDeferreds r �test_awaitReturnsIterablez$AwaitTests.test_awaitReturnsIterable$ s+ � � %�J���+�+�-������$��*?�@r c � �� dt f�fd�}dt fd�� |� }| j |t j � t j |� }| j |t � | j |� }| j |d� y)zU L{Deferred.fromCoroutine} will turn a coroutine into a L{Deferred}. �returnc � �` �K � t d� } | � d { ��� �� � d { ��� }|S 7 �7 ��w)N�bar�r )r �res�run2s �r �runz2AwaitTests.test_deferredFromCoroutine.<locals>.run1 s. �� �� ����A��G�G���,�C��J� ���s �.�*�.�,�.�.c � �<