| Server IP : 198.244.165.102 / Your IP : 216.73.216.156 [ Web Server : nginx/1.24.0 System : Linux modovh-ub-01 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : colleary ( 1011) PHP Version : 8.3.23 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/twisted/python/test/__pycache__/ |
Upload File : |
�
oj � �P � d Z ddlZddlmZ ddlmZmZmZ ddlm Z G d� 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 �^ � e Zd ZdZdee ddfd�Zdeeee f ddfd�Z
d
dedee fd �Zy)�TwistedModulesMixinz�
A mixin for C{twisted.trial.unittest.SynchronousTestCase} providing useful
methods for manipulating Python's module system.
�sysPath�returnNc � �� t j dd �d�fd�}| j |� |t j dd y)zW
Replace sys.path, for the duration of the test, with the given value.
Nc �, �� � t j d d y �N)�sys�path)�originalSysPaths ��E/usr/lib/python3/dist-packages/twisted/python/test/modules_helpers.py�cleanUpSysPathz:TwistedModulesMixin.replaceSysPath.<locals>.cleanUpSysPath s �� �)�C�H�H�Q�K� �r N)r r �
addCleanup)�selfr
r r s @r �replaceSysPathz"TwistedModulesMixin.replaceSysPath s2 �� � �(�(�1�+�� *�
����'������r �
sysModulesc �� �� t j j � �d�fd�}| j |� t j j � t j j |� y)zZ
Replace sys.modules, for the duration of the test, with the given value.
Nc � �� t j j � t j j � � y r )r �modules�clear�update)�originalSysModuless �r �cleanUpSysModulesz@TwistedModulesMixin.replaceSysModules.<locals>.cleanUpSysModules( s&