| Server IP : 159.69.118.108 / Your IP : 216.73.216.231 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-4gb-fsn1-1 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 13:53:54 UTC 2025 aarch64 User : root ( 0) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/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&