o
    Òó·iK  ã                   @   sJ   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ dej	ƒZ
dS )	z%
Tests for L{twisted.internet.main}.
é    )ÚReactorAlreadyInstalledError)ÚinstallReactor)Ú	NoReactor)Úunittestc                   @   s.   e Zd ZdZd
dd„Zd
dd„Zd
dd	„ZdS )ÚInstallReactorTestsz&
    Tests for L{installReactor}.
    ÚreturnNc                 C   sR   t ƒ � tƒ }t|ƒ ddlm} |  ||¡ W d  ƒ dS 1 s"w   Y  dS )zN
        L{installReactor} installs a new reactor if none is present.
        r   )ÚreactorN)r   Úobjectr   Ztwisted.internetr   ZassertIs)ÚselfZ
newReactorr   © r   úeC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/internet/test/test_main.pyÚtest_installReactor   s   "ûz'InstallReactorTests.test_installReactorc                 C   sF   t ƒ � ttƒ ƒ |  tttƒ ¡ W d  ƒ dS 1 sw   Y  dS )zv
        If a reactor is already installed, L{installReactor} raises
        L{ReactorAlreadyInstalledError}.
        N)r   r   r	   ÚassertRaisesr   ©r
   r   r   r   Útest_alreadyInstalled   s   
"þz)InstallReactorTests.test_alreadyInstalledc                 C   s   |   tttƒ¡ dS )zo
        For backwards compatibility, L{ReactorAlreadyInstalledError} is an
        L{AssertionError}.
        N)Ú
assertTrueÚ
issubclassr   ÚAssertionErrorr   r   r   r   Útest_errorIsAnAssertionError(   s   z0InstallReactorTests.test_errorIsAnAssertionError)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s
    

	r   N)r   Ztwisted.internet.errorr   Ztwisted.internet.mainr   Z#twisted.internet.test.modulehelpersr   Ztwisted.trialr   ZSynchronousTestCaser   r   r   r   r   Ú<module>   s   