AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/python/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/python/test/__pycache__/modules_helpers.cpython-310.pyc
o

�b
�@sJdZddlZddlmZddlmZmZmZddlm	Z	Gdd�d�Z
dS)z\
Facilities for helping test code which interacts with Python's module system
to load code.
�N)�
ModuleType)�Iterable�List�Tuple)�FilePathc@sXeZdZdZdeeddfdd�Zdeeee	fddfdd	�Z
ddedefdd
�ZdS)�TwistedModulesMixinz�
    A mixin for C{twisted.trial.unittest.SynchronousTestCase} providing useful
    methods for manipulating Python's module system.
    �sysPath�returnNcs8tjdd��d�fdd�}|�|�|tjdd�<dS)zW
        Replace sys.path, for the duration of the test, with the given value.
        Nr	cs�tjdd�<dS�N)�sys�path���originalSysPathr
�E/usr/lib/python3/dist-packages/twisted/python/test/modules_helpers.py�cleanUpSysPathsz:TwistedModulesMixin.replaceSysPath.<locals>.cleanUpSysPath�r	N)rr�
addCleanup)�selfrrr
rr�replaceSysPaths
z"TwistedModulesMixin.replaceSysPath�
sysModulescs<tj���d�fdd�}|�|�tj��tj�|�dS)zZ
        Replace sys.modules, for the duration of the test, with the given value.
        r	Ncstj��tj���dSr
)r�modules�clear�updater
��originalSysModulesr
r�cleanUpSysModules(s
z@TwistedModulesMixin.replaceSysModules.<locals>.cleanUpSysModulesr)rr�copyrrr)rrrr
rr�replaceSysModules"s



z%TwistedModulesMixin.replaceSysModules�test_package�pkgnamecCs2t|���}|�d�}|��|�d��d�|S)z�
        Generate a L{FilePath} with one package, named C{pkgname}, on it, and
        return the L{FilePath} of the path entry.
        rz__init__.py�)r�mktemp�child�makedirs�
setContent)rr �entry�pkgr
r
r�pathEntryWithOnePackage0s

z+TwistedModulesMixin.pathEntryWithOnePackage)r)
�__name__�
__module__�__qualname__�__doc__r�strrrrrrrr(r
r
r
rrs
r)r,r�typesr�typingrrr�twisted.python.filepathrrr
r
r
r�<module>s

Anon7 - 2022
AnonSec Team