Ë
    oj  ã                   óŒ   — d Z ddlZddlmZ ddlmZ  G d„ de«      Z	 ddlmZ	 e	ZdZe€dZ G d	„ d
e«      Zy# e
$ r dZY Œw xY w)z&
Tests for twisted.internet.glibbase.
é    N)ÚensureNotImported)ÚTestCasec                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)ÚEnsureNotImportedTestszQ
    L{ensureNotImported} protects against unwanted past and future imports.
    c                 ó†   — i }| j                  t        d|«       t        ddgdg d¢¬«       | j                  |ddddœ«       y)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.)r	   r
   Úm3©ÚpreventImportsN©ÚpatchÚsysr   ÚassertEqual©Úselfr   s     úE/usr/lib/python3/dist-packages/twisted/internet/test/test_glibbase.pyÚtest_ensureWhenNotImportedz1EnsureNotImportedTests.test_ensureWhenNotImported   sA   € ð ˆØ�
‰
”3˜	 7Ô+Ü˜4 ˜,¨ÒEWÕXØ×Ñ˜¨°TÀÑ"FÕGó    c                 óv   — i }| j                  t        d|«       t        ddgd«       | j                  |i «       y)z˜
        If the specified modules have never been imported, and import
        prevention is not requested, L{ensureNotImported} has no effect.
        r   r	   r
   r   Nr   r   s     r   Ú%test_ensureWhenNotImportedDontPreventz<EnsureNotImportedTests.test_ensureWhenNotImportedDontPrevent   s7   € ð
 ˆØ�
‰
”3˜	 7Ô+Ü˜4 ˜,¨Ô5Ø×Ñ˜ "Õ%r   c                 óˆ   — ddi}| j                  t        d|«       t        ddgdddg¬«       | j                  |dddœ«       y)z†
        If the specified modules have been set to L{None} in C{sys.modules},
        L{ensureNotImported} does not complain.
        r
   Nr   r	   r   r   )r	   r
   r   r   s     r   Útest_ensureWhenFailedToImportz4EnsureNotImportedTests.test_ensureWhenFailedToImport)   sF   € ð
 ˜�,ˆØ�
‰
”3˜	 7Ô+Ü˜4 ˜,¨ÀdÈDÀ\ÕRØ×Ñ˜¨°TÑ":Õ;r   c                 óò   — t        «       }d|i}| j                  t        d|«       | j                  t        t
        ddgdddg¬«      }| j                  |d|i«       | j                  |j                  d«       y)z�
        If one of the specified modules has been previously imported,
        L{ensureNotImported} raises an exception.
        r
   r   r	   r   r   )r   N)Úobjectr   r   ÚassertRaisesÚImportErrorr   r   Úargs)r   Úmoduler   Úes       r   Útest_ensureFailsWhenImportedz3EnsureNotImportedTests.test_ensureFailsWhenImported3   sz   € ô
 “ˆØ˜�.ˆØ�
‰
”3˜	 7Ô+Ø×ÑÜÜØ�4ˆLØØ  $˜<ð ó 
ˆð 	×Ñ˜ 4¨ .Ô1Ø×Ñ˜Ÿ™ Õ1r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r#   © r   r   r   r      s   „ ñò	Hò&ò<ó2r   r   )Ú	gireactorzgi reactor not availablec                   ó   — e Zd ZdZeZd„ Zy)ÚGlibReactorBaseTestsz•
    Tests for the private C{twisted.internet._glibbase.GlibReactorBase}
    done via the public C{twisted.internet.gireactor.PortableGIReactor}
    c                 ó�   — t         j                  d¬«      }| j                  d|j                  «       «       |j	                  «        y)z²
        C{simulate} can be called without raising any errors when there are
        no delayed calls for the reactor and hence there is no defined sleep
        period.
        F)ÚuseGtkN)r)   ÚPortableGIReactorÚassertIsÚtimeoutÚsimulate)r   Úsuts     r   Útest_simulatez"GlibReactorBaseTests.test_simulateZ   s4   € ô ×)Ñ)°Ð)Ó7ˆà�‰�d˜CŸK™K›MÔ*à�‰�r   N)r$   r%   r&   r'   ÚmissingGlibReactorÚskipr3   r(   r   r   r+   r+   R   s   „ ñð
 €Dó
r   r+   )r'   r   Útwisted.internet._glibbaser   Útwisted.trial.unittestr   r   Útwisted.internetr)   Ú
_gireactorr   r4   r+   r(   r   r   ú<module>r:      se   ðñó
 å 8Ý +ô42˜Xô 42ðnÝ8ð €IàÐ ØÐØ3Ðô˜8õ øð ò Ø‚Iðús   Ÿ9 ¹AÁA