o
    b3                     @   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 Zdd Zdd ZdS )	InstallReactorTestsz&
    Tests for L{installReactor}.
    c                 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   twisted.internetr   assertIs)self
newReactorr    r   A/usr/lib/python3/dist-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_errorIsAnAssertionErrorN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r      s
    	r   N)r   twisted.internet.errorr   twisted.internet.mainr   #twisted.internet.test.modulehelpersr   twisted.trialr   SynchronousTestCaser   r   r   r   r   <module>   s   