HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_glibbase.cpython-310.pyc
o

�b��@s8dZddlZddlmZddlmZGdd�de�ZdS)z&
Tests for twisted.internet.glibbase.
�N)�ensureNotImported)�TestCasec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�EnsureNotImportedTestszQ
    L{ensureNotImported} protects against unwanted past and future imports.
    cCs@i}|�td|�tddgdgd�d�|�|dddd��dS)z�
        If the specified modules have never been imported, and import
        prevention is requested, L{ensureNotImported} makes sure they will not
        be imported in the future.
        �modules�m1�m2�
A message.)rr�m3��preventImportsN��patch�sysr�assertEqual��selfr�r�E/usr/lib/python3/dist-packages/twisted/internet/test/test_glibbase.py�test_ensureWhenNotImportedsz1EnsureNotImportedTests.test_ensureWhenNotImportedcCs0i}|�td|�tddgd�|�|i�dS)z�
        If the specified modules have never been imported, and import
        prevention is not requested, L{ensureNotImported} has no effect.
        rrrrNrrrrr�%test_ensureWhenNotImportedDontPreventsz<EnsureNotImportedTests.test_ensureWhenNotImportedDontPreventcCsBddi}|�td|�tddgdddgd�|�|ddd��dS)z�
        If the specified modules have been set to L{None} in C{sys.modules},
        L{ensureNotImported} does not complain.
        rNrrrr
)rrrrrrr�test_ensureWhenFailedToImport)sz4EnsureNotImportedTests.test_ensureWhenFailedToImportcCsZt�}d|i}|�td|�|jttddgdddgd�}|�|d|i�|�|jd�dS)z�
        If one of the specified modules has been previously imported,
        L{ensureNotImported} raises an exception.
        rrrrr
)rN)�objectr
r�assertRaises�ImportErrorrr�args)r�moduler�errr�test_ensureFailsWhenImported3s�z3EnsureNotImportedTests.test_ensureFailsWhenImportedN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrrs

r)r!r�twisted.internet._glibbaser�twisted.trial.unittestrrrrrr�<module>s