o
    Óó·i  ã                   @  sv   d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
 ddlmZ eejƒG dd„ dƒƒZG d	d
„ d
e
jƒZdS )z,
Tests for various parts of L{twisted.web}.
é    )Úannotations)ÚimplementerÚverify)ÚdeferÚ
interfaces)Úunittest)Úclientc                   @  s.   e Zd ZdZddd„Zddd	„Zddd„ZdS )ÚDummyEndPointz*An endpoint that does not connect anywhereÚ
someStringÚstrÚreturnÚNonec                 C  s
   || _ d S )N©r
   )Úselfr
   © r   úbC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/web/test/test_client.pyÚ__init__   s   
zDummyEndPoint.__init__c                 C  s   d| j › d�S )NzDummyEndPoint(ú)r   )r   r   r   r   Ú__repr__   s   zDummyEndPoint.__repr__Úfactoryúinterfaces.IProtocolFactoryú6defer.Deferred[dict[str, interfaces.IProtocolFactory]]c                 C  s   t  t|d�¡S )N)r   )r   ZsucceedÚdict)r   r   r   r   r   Úconnect   s   zDummyEndPoint.connectN)r
   r   r   r   )r   r   )r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r	      s
    

r	   c                   @  s$   e Zd ZdZd	dd„Zd	dd„ZdS )
ÚHTTPConnectionPoolTestsz:
    Unit tests for L{client.HTTPConnectionPoolTest}.
    r   r   c                 C  s   t dƒ}t tj|¡ dS )z@L{DummyEndPoint}s implements L{interfaces.IStreamClientEndpoint}Z	somethingN)r	   r   ZverifyObjectr   ÚIStreamClientEndpoint)r   Úepr   r   r   Útest_implements&   s   z'HTTPConnectionPoolTests.test_implementsc                 C  sF   t jdd�}tdƒ}| d|¡}|  |¡}t|ƒ}|  t|ƒ|¡ dS )z2connection L{repr()} includes endpoint's L{repr()}N)ZreactorZthis_is_probably_uniqueZ	someplace)r   ÚHTTPConnectionPoolr	   ÚgetConnectionZsuccessResultOfÚreprZassertIn)r   Úpoolr    ÚdÚresultZrepresentationr   r   r   Ú	test_repr+   s   
z!HTTPConnectionPoolTests.test_reprN)r   r   )r   r   r   r   r!   r(   r   r   r   r   r   !   s    
r   N)r   Ú
__future__r   Zzope.interfacer   r   Ztwisted.internetr   r   Ztwisted.trialr   Ztwisted.webr   r   r	   ZTestCaser   r   r   r   r   Ú<module>   s   