HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3.9/site-packages/tracer/tests/__pycache__/test_processes.cpython-39.pyc
a

�|
`�@s^ddlTddlmZmZmZddlmZddlZddlZGdd�de	j
�ZGdd	�d	e�ZdS)
�)�*�)�	Processes�Process�ProcessWrapper)�ProcessesCollectionNc@sPeZdZe�dd�dd��Ze�dd�dd��Ze�dd�dd��Zd	d
�ZdS)�
TestProcessesTz%@TODO Create Mock for Processes classcCs:t��d}|��}|�|t�|D]}|�|t�q$dS)Nr)r�all�childrenZassertIsInstancerr)�self�processr
�child�r�?/usr/lib/python3.9/site-packages/tracer/tests/test_processes.py�
test_children
s
zTestProcesses.test_childrencCs|tt���}tt���}|�|tt����|�||���|�||���t��tt���}|�	||�|�
||�dS�N)r�os�getpid�getppidZassertIs�parentZassertInr
Zreset_cache�assertEqualZassertIsNot)rrrZprocess2rrr�test_unique_processsz!TestProcesses.test_unique_processcCsdtt���}|��tjtjjtjd�}|�	dt
|����|��|�	dt
|����|��dS)N)�stdinrr)
rrrr
�
subprocess�Popen�sys�
executable�PIPEr�lenZ
rebuild_cacheZ	terminate)rrr
rrr�test_process_caching!sz"TestProcesses.test_process_cachingcCszt�}ddgd�d�|_|��dks(J�t�}ddgd�d�|_|��dksPJ�t�}dddgd�|_|��dksvJ�dS)NZsshd�/usr/sbin/sshd)r z-DZfooZbar)�nameZexeZcmdline)Zsome�thing�andZ	argumentsZidkZwhatzssh-thing-sessionZ
withoutparams)�ProcessMock�datar!)rZp1Zp2Zp3rrr�test_name_sshd0s"���zTestProcesses.test_name_sshdN)	�__name__�
__module__�__qualname__�unittestZskipIfrrrr&rrrrrs





rc@seZdZdd�Zdd�ZdS)r$cCs
i|_dSr�r%)rrrr�__init__EszProcessMock.__init__cCs
|j|Srr+)rr!rrr�_attrHszProcessMock._attrN)r'r(r)r,r-rrrrr$Dsr$)
Z__meta__Ztracer.resources.processesrrrZtracer.resources.collectionsrrrr*ZTestCaserr$rrrr�<module>s<