- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.141.12.172
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_applications.cpython-36.pyc
3

"e��
@s�ddlTddlmZddlmZmZddlmZmZyddl	m
Z
mZdZWn ddl
m
Z
mZdZYnXGd	d
�d
ej�Zedkr�ej�dS)
�)�*�)�DATA_DIR)�Applications�Application)�ApplicationsCollection�ProcessesCollection)�patch�	mock_openz
builtins.openz__builtin__.openc@s�eZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
dd�dd��Zdd�Zdd�Z
dd�Zdd�Ze
ddd�dd��Zdd�Zd S)!�TestApplicationscCsdd�tjD�|_dS)NcSsg|]}|jt�r|�qS�)�
startswithr)�.0�xrr�'/usr/lib/python3.6/test_applications.py�
<listcomp>sz/TestApplications.setUpClass.<locals>.<listcomp>)r�DEFINITIONS)�clsrrr�
setUpClassszTestApplications.setUpClasscCs|jt_dt_dS)N)rrZ_apps)�selfrrr�setUpszTestApplications.setUpcCs|jtj�t�dS)N)�assertIsInstancer�allr)rrrr�test_apps_typessz TestApplications.test_apps_typescCstj�d}|j|jt�dS)Nr)rrrZ	instancesr)r�applicationrrr�test_application_processessz+TestApplications.test_application_processescCs�d}x�tj�D]�}d|ks&t|�dkr8|jdt|��d|kr`|jtjj�kr`|jd|j�d|krldnd}|jt|�|d	j	|j
��|d7}qWdS)
Nr�namezMissing name in definition #�typezUnknown type in application: �rename��z)Application {0} has unsupported attribute)rr�len�fail�strrZTYPES�values�assertEqual�formatr)r�i�a�nrrr�test_apps_attributes sz%TestApplications.test_apps_attributescCs<tj�}x.|D]&}|j|j|�dkr|jd|j�qWdS)NrzDuplicate definitions for: )rr�_countrr")r�appsr(rrr�test_apps_duplicity.s
z$TestApplications.test_apps_duplicityz0tracer.resources.applications.System.init_systemZdummy)Zreturn_valuecCsfd}tj|�}|j|j|�|j|jtj�|j|jd�|j|jd�|jt|�ddj	|j��dS)NZNON_EXISTING_APPLICATIONr z)Application {0} has unsupported attribute)
r�findr%rrZDEFAULT_TYPE�helperZnoter!r&)rZinit_system�app_nameZapprrr�test_app_with_no_definition4s
z,TestApplications.test_app_with_no_definitioncCs0tddi�}|jt|�d�|jt|�d�dS)Nr�fooz<Application: foo>)rr%r#�repr)rZrulerrr�test_representations>sz%TestApplications.test_representationscCs<tdddd��}tdddd��}|j|j�|j|j�dS)Nr2�applicaitonzsome helper)rrr/rz some helper with {NAME} argument)r�assertFalse�helper_contains_name�
assertTrue)r�a1Za2rrr�test_contains_nameCsz#TestApplications.test_contains_namecCs<tdddd��}tdddd��}|j|j�|j|j�dS)Nr2r5zsome helper)rrr/rzsome helper with {FOO} argument)rr6�helper_contains_formatingr8)rr9Za3rrr�test_contains_formatingIsz(TestApplications.test_contains_formatingcCs,tdddd��}|j|j�|j|j�dS)Nr2r5)rrr/)rr6r;r7)rr9rrr�test_helper_contains_when_noneOsz/TestApplications.test_helper_contains_when_nonez*tracer.resources.system.System.init_systemZsystemdcCs�dgt_d}ttt|d����tj�}|jt|�d�|jtdd�|D���|j|dj	d�|j|dj
jd	��|j|d
jd�|j
d|d
j
�Wd
QRXd
S)z6
		Test parsing a single XML file with applications
		zwhatever-file.xmlz�<applications>    <app name='foo' type='daemon' />    <group type='session'>        <app name='bar' />        <app name='baz' helper='Or kill it and see what happens' />    </group></applications>)Z	read_data�cSsg|]}t|t��qSr)�
isinstancer)rrrrrrfsz.TestApplications.test_load.<locals>.<listcomp>rr2zsystemctl restart foo�Zsessionzkill itN)rrr	�
builtins_openr
rr%r!r8rr/�endswithrZassertIn)rZ_init_system�datar,rrr�	test_loadTszTestApplications.test_loadcCs(d}x|D]}|j|kr
|d7}q
W|S)Nrr)r)rr0r,�countr(rrrr+ls


zTestApplications._countN)�__name__�
__module__�__qualname__�classmethodrrrrr*r-r	r1r4r:r<r=rDr+rrrrrs
r�__main__N)Z__meta__Ztracer.pathsrZtracer.resources.applicationsrrZtracer.resources.collectionsrrZ
unittest.mockr	r
rAZmockZunittestZTestCaserrF�mainrrrr�<module>s
f

Youez - 2016 - github.com/yon3zu
LinuXploit