- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.227.46.54
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/tracer/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/tracer/tests/__pycache__/test_rules.cpython-36.pyc
3

"e��
@s�ddlTddlmZddlmZmZyddlmZmZdZ	Wn ddl
mZmZdZ	YnXGdd	�d	ej�Z
ed
kr�ej�dS)�)�*�)�DATA_DIR)�Rules�Rule)�patch�	mock_openz
builtins.openz__builtin__.openc@s`eZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dS)�	TestRulescCsdd�tjD�|_dS)NcSsg|]}|jt�r|�qS�)�
startswithr)�.0�xr
r
� /usr/lib/python3.6/test_rules.py�
<listcomp>sz(TestRules.setUpClass.<locals>.<listcomp>)r�DEFINITIONS)�clsr
r
r�
setUpClassszTestRules.setUpClasscCs|jt_dt_dS)N)rrZ_rules)�selfr
r
r�setUpszTestRules.setUpcCs"xtj�D]}|j|t�q
WdS)N)r�allZassertIsInstancer)r�ruler
r
r�test_rules_typesszTestRules.test_rules_typescCs�d}xvtj�D]j}d|ks"d|kr4|jdt|��|jtjj�krT|jd|j�t|�dkrp|jd|j�|d7}qWdS)Nr�name�actionzMissing attributes in rule #zUnknown action in rule: �z Unsupported attributes in rule: )	rr�fail�strrZACTIONS�valuesr�len)r�i�rr
r
r�test_rules_attributesszTestRules.test_rules_attributescCs8tj�}x*|D]"}|j|�dkr|jd|j�qWdS)NrzDuplicate rules for: )rr�countrr)r�rulesr r
r
r�test_rules_duplicity*s
zTestRules.test_rules_duplicitycCs|jtjd��dS)NZNON_EXISTING_APPLICATION)ZassertIsNoner�find)rr
r
r�test_app_with_no_rule0szTestRules.test_app_with_no_rulecCs0tddi�}|jt|�d�|jt|�d�dS)Nr�fooz<Rule: foo>)r�assertEqualr�repr)rrr
r
r�test_representations3szTestRules.test_representationscCs8tddd��}tddd��}|j|�|j|jd�dS)Nr'�bar)rrZbaz)r�updater(r)rZr1Zr2r
r
r�test_update8s
zTestRules.test_updatecCs�dgt_d}ttt|d���ltj�}|jt|�d�|jtdd�|D���|j|dj	d�|j|dj
d	�|j|d
j	d�WdQRXdS)
z/
		Test parsing a single XML file with rules
		zwhatever-file.xmlzM<rules>    <rule name='foo' action='return' />    <rule name='bar' /></rules>)Z	read_datarcSsg|]}t|t��qSr
)�
isinstancer)rr
r
r
rrMsz'TestRules.test_load.<locals>.<listcomp>rr'�returnrr+N)rrr�
builtins_openrrr(rZ
assertTruerr)r�datar#r
r
r�	test_load?szTestRules.test_loadcCs(d}x|D]}|j|kr
|d7}q
W|S)Nrr)r)rZapp_nameZappsr"�ar
r
r�_countRs


zTestRules._countN)�__name__�
__module__�__qualname__�classmethodrrrr!r$r&r*r-r2r4r
r
r
rr	
sr	�__main__N)Z__meta__Ztracer.pathsrZtracer.resources.rulesrrZ
unittest.mockrrr0ZmockZunittestZTestCaser	r5�mainr
r
r
r�<module>s
M

Youez - 2016 - github.com/yon3zu
LinuXploit