+
    Dfj                         R t ^ RIt^ RIHt ^ RIHt  ! R R]4      t ^ RIHt	 ]	tRt]f   Rt ! R R	]4      tR#   ]
 d    Rt L i ; i)
z&
Tests for twisted.internet.glibbase.
N)ensureNotImported)TestCasec                   <   a  ] tR t^t o RtR tR tR tR tRt	V t
R# )EnsureNotImportedTestszI
L{ensureNotImported} protects against unwanted past and future imports.
c           	         / pV P                  \        RV4       \        RR.R. ROR7       V P                  VRRRRRR/4       R# )	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.m3preventImportsN)r   r	   r   patchsysr   assertEqualselfr   s   & E/usr/lib/python3/dist-packages/twisted/internet/test/test_glibbase.pytest_ensureWhenNotImported1EnsureNotImportedTests.test_ensureWhenNotImported   sG     

3	7+4,EWX4tT4"FG    c                x    / pV P                  \        RV4       \        RR.R4       V P                  V/ 4       R# )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_ensureWhenNotImportedDontPrevent<EnsureNotImportedTests.test_ensureWhenNotImportedDontPrevent   s7    
 

3	7+4,5"%r   c                    RR/pV P                  \        RV4       \        RR.RRR.R7       V P                  VRRRR/4       R# )zn
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   s   & r   test_ensureWhenFailedToImport4EnsureNotImportedTests.test_ensureWhenFailedToImport)   sJ    
 ,

3	7+4,dD\R4tT":;r   c                    \        4       pRV/pV P                  \        RV4       V P                  \        \
        RR.RRR.R7      pV P                  VRV/4       V P                  VP                  R4       R# )zi
If one of the specified modules has been previously imported,
L{ensureNotImported} raises an exception.
r	   r   r   r
   r   N)r
   )objectr   r   assertRaisesImportErrorr   r   args)r   moduler   es   &   r   test_ensureFailsWhenImported3EnsureNotImportedTests.test_ensureFailsWhenImported3   sz    
 .

3	7+4L $<  
 	4.11r    N)__name__
__module____qualname____firstlineno____doc__r   r   r   r%   __static_attributes____classdictcell____classdict__s   @r   r   r      s$     	H&<2 2r   r   )	gireactorzgi reactor not availablec                   .   a  ] tR t^Rt o Rt]tR tRtV t	R# )GlibReactorBaseTestsz
Tests for the private C{twisted.internet._glibbase.GlibReactorBase}
done via the public C{twisted.internet.gireactor.PortableGIReactor}
c                    \         P                  RR7      pV P                  RVP                  4       4       VP	                  4        R# )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)r1   PortableGIReactorassertIstimeoutsimulate)r   suts   & r   test_simulate"GlibReactorBaseTests.test_simulateZ   s4     )))7dCKKM*r   r'   N)
r(   r)   r*   r+   r,   missingGlibReactorskipr;   r-   r.   r/   s   @r   r3   r3   R   s     
 D
 
r   r3   )r,   r   twisted.internet._glibbaser   twisted.trial.unittestr   r   twisted.internetr1   
_gireactorr!   r=   r3   r'   r   r   <module>rC      se   
  8 +42X 42n8 I 38   Is   < 	AA