+
    Dfj                     R    R t ^ RIt^ RIHt ^ RIHtHtHt ^ RIH	t	  ! R R4      t
R# )z\
Facilities for helping test code which interacts with Python's module system
to load code.
N)
ModuleType)IterableListTuple)FilePathc                   ^   a  ] tR t^t o RtV 3R lR ltV 3R lR ltR
V 3R lR lltRtV t	R	# )TwistedModulesMixinz}
A mixin for C{twisted.trial.unittest.SynchronousTestCase} providing useful
methods for manipulating Python's module system.
c                4   < V ^8  d   QhRS[ S[,          RR/# )   sysPathreturnN)r   str)format__classdict__s   "E/usr/lib/python3/dist-packages/twisted/python/test/modules_helpers.py__annotate__ TwistedModulesMixin.__annotate__   s     
 
d3i 
D 
    c                   a \         P                  R,          oR V3R llpV P                  V4       V\         P                  R&   R# )zG
Replace sys.path, for the duration of the test, with the given value.
NNNc                    V ^8  d   QhRR/# r
   r   N )r   s   "r   r   8TwistedModulesMixin.replaceSysPath.<locals>.__annotate__   s     	* 	* 	*r   c                  .   < S \         P                  R &   R# )r   N)syspath)originalSysPaths   r   cleanUpSysPath:TwistedModulesMixin.replaceSysPath.<locals>.cleanUpSysPath   s    )CHHQKr   N)r   r   
addCleanup)selfr   r   r   s   && @r   replaceSysPath"TwistedModulesMixin.replaceSysPath   s7     ((1+	* 	* 	'r   c                J   < V ^8  d   QhRS[ S[S[S[3,          ,          RR/# )r
   
sysModulesr   N)r   r   r   r   )r   r   s   "r   r   r   "   s*     ' 'HU3
?5K,L 'QU 'r   c                   a \         P                  P                  4       oR V3R llpV P                  V4       \         P                  P	                  4        \         P                  P                  V4       R# )zJ
Replace sys.modules, for the duration of the test, with the given value.
c                    V ^8  d   QhRR/# r   r   )r   s   "r   r   ;TwistedModulesMixin.replaceSysModules.<locals>.__annotate__(   s     	3 	34 	3r   c                     < \         P                  P                  4        \         P                  P                  S 4       R # )N)r   modulesclearupdate)originalSysModuless   r   cleanUpSysModules@TwistedModulesMixin.replaceSysModules.<locals>.cleanUpSysModules(   s&    KKKK12r   N)r   r*   copyr    r+   r,   )r!   r%   r.   r-   s   && @r   replaceSysModules%TwistedModulesMixin.replaceSysModules"   sS     ![[--/	3 	3 	)*:&r   c                6   < V ^8  d   QhRS[ RS[S[ ,          /# )r
   pkgnamer   )r   r   )r   r   s   "r   r   r   0   s      	 	s 	QT 	r   c                    \        V P                  4       4      pVP                  R4      pVP                  4        VP                  R4      P	                  R4       V# )zq
Generate a L{FilePath} with one package, named C{pkgname}, on it, and
return the L{FilePath} of the path entry.
test_packagez__init__.pyr   )r   mktempchildmakedirs
setContent)r!   r4   entrypkgs   &&  r   pathEntryWithOnePackage+TwistedModulesMixin.pathEntryWithOnePackage0   sG    
 'kk.)		- ++C0r   r   N)r6   )
__name__
__module____qualname____firstlineno____doc__r"   r1   r=   __static_attributes____classdictcell__)r   s   @r   r   r      s-     

 
' '	 	 	r   r   )rC   r   typesr   typingr   r   r   twisted.python.filepathr   r   r   r   r   <module>rI      s%   
   ( ( ,) )r   