OXIESEC PANEL
- Current Dir:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
testfixtures
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:06 AM
rwxr-xr-x
📄
__init__.py
1.19 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
__pycache__
-
02/07/2025 10:01:36 PM
rwxr-xr-x
📄
comparison.py
39.14 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
compat.py
224 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
components.py
1.31 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
datetime.py
24.42 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
django.py
2.88 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
logcapture.py
10.75 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
mock.py
1.21 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
outputcapture.py
4.69 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
popen.py
9.89 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
replace.py
12.15 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
resolve.py
2.05 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
rmtree.py
2.52 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
shouldraise.py
3.58 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
shouldwarn.py
2.21 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
sybil.py
2.28 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
tempdirectory.py
12.89 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
tests
-
02/07/2025 10:01:36 PM
rwxr-xr-x
📄
twisted.py
4.8 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
utils.py
2.74 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
version.txt
6 bytes
12/18/2024 10:23:15 AM
rw-r--r--
Editing: components.py
Close
""" Helpers for working with Zope and its components. """ import atexit import warnings from typing import Set from zope.component import getSiteManager from zope.interface.registry import Components class TestComponents: """ A helper for providing a sterile registry when testing with ``zope.component``. Instantiation will install an empty registry that will be returned by :func:`zope.component.getSiteManager`. """ __test__: bool = False instances: Set['TestComponents'] = set() atexit_setup: bool = False def __init__(self): self.registry: Components = Components('Testing') self.old: Components = getSiteManager.sethook(lambda: self.registry) self.instances.add(self) if not self.__class__.atexit_setup: atexit.register(self.atexit) self.__class__.atexit_setup = True def uninstall(self): """ Remove the sterile registry and replace it with the one that was in place before this :class:`TestComponents` was instantiated. """ getSiteManager.sethook(self.old) self.instances.remove(self) @classmethod def atexit(cls): if cls.instances: warnings.warn( 'TestComponents instances not uninstalled by shutdown!' )