§
    Ètºf  ã                   óœ   — 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n# e
$ r dZY nw xY wdZe€dZ G d	„ d
e¦  «        ZdS )z&
Tests for twisted.internet.glibbase.
é    N)ÚensureNotImported)ÚTestCasec                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )ÚEnsureNotImportedTestszQ
    L{ensureNotImported} protects against unwanted past and future imports.
    c                 ó¢   — i }|                       t          d|¦  «         t          ddgdg d¢¬¦  «         |                      |ddddœ¦  «         dS )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     úb/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/internet/test/test_glibbase.pyÚtest_ensureWhenNotImportedz1EnsureNotImportedTests.test_ensureWhenNotImported   se   € ð ˆØ�
Š
•3˜	 7Ñ+Ô+Ð+Ý˜4 ˜,¨ÐEWÐEWÐEWÐXÑXÔXÐXØ×Ò˜¨°TÀÐ"FÐ"FÑGÔGÐGÐGÐGó    c                 ó’   — i }|                       t          d|¦  «         t          ddgd¦  «         |                      |i ¦  «         dS )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   sO   € ð
 ˆØ�
Š
•3˜	 7Ñ+Ô+Ð+Ý˜4 ˜,¨Ñ5Ô5Ð5Ø×Ò˜ "Ñ%Ô%Ð%Ð%Ð%r   c                 ó¤   — ddi}|                       t          d|¦  «         t          ddgdddg¬¦  «         |                      |dddœ¦  «         dS )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)   sd   € ð
 ˜�,ˆØ�
Š
•3˜	 7Ñ+Ô+Ð+Ý˜4 ˜,¨ÀdÈDÀ\ÐRÑRÔRÐRØ×Ò˜¨°TÐ":Ð":Ñ;Ô;Ð;Ð;Ð;r   c                 ó  — t          ¦   «         }d|i}|                      t          d|¦  «         |                      t          t
          ddgdddg¬¦  «        }|                      |d|i¦  «         |                      |j        d¦  «         dS )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   s—   € õ
 ‘”ˆØ˜�.ˆØ�
Š
•3˜	 7Ñ+Ô+Ð+Ø×ÒÝÝØ�4ˆLØØ  $˜<ð ñ 
ô 
ˆð 	×Ò˜ 4¨ .Ñ1Ô1Ð1Ø×Ò˜œ Ñ1Ô1Ð1Ð1Ð1r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r#   © r   r   r   r      s]   € € € € € ðð ð	Hð 	Hð 	Hð&ð &ð &ð<ð <ð <ð2ð 2ð 2ð 2ð 2r   r   )Ú	gireactorzgi reactor not availablec                   ó   — e Zd ZdZeZd„ ZdS )ÚGlibReactorBaseTestsz•
    Tests for the private C{twisted.internet._glibbase.GlibReactorBase}
    done via the public C{twisted.internet.gireactor.PortableGIReactor}
    c                 ó´   — t                                d¬¦  «        }|                      d|                     ¦   «         ¦  «         |                     ¦   «          dS )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   sG   € õ ×)Ò)°Ð)Ñ7Ô7ˆà�Š�d˜CŸKšK™MœMÑ*Ô*Ð*à�Š‰Œˆˆˆr   N)r$   r%   r&   r'   ÚmissingGlibReactorÚskipr3   r(   r   r   r+   r+   R   s4   € € € € € ðð ð
 €Dð
ð 
ð 
ð 
ð 
r   r+   )r'   r   Útwisted.internet._glibbaser   Útwisted.trial.unittestr   r   Útwisted.internetr)   Ú
_gireactorr   r4   r+   r(   r   r   ú<module>r:      s÷   ððð ð
 €
€
€
à 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø +Ð +Ð +Ð +Ð +Ð +ð42ð 42ð 42ð 42ð 42˜Xñ 42ô 42ð 42ðnØ8Ð8Ð8Ð8Ð8Ð8ð €I€Iøð ð ð ð Ø€I€I€Iðøøøð
 Ð ØÐØ3Ððð ð ð ð ˜8ñ ô ð ð ð s   ¢+ «5´5