| Server IP : 85.155.190.233 / Your IP : 216.73.216.103 Web Server : nginx/1.24.0 System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : wp-moonbloom ( 1001) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/twisted/runner/test/__pycache__/ |
Upload File : |
�
ojd � �� � d Z ddlZddlmZmZmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZmZ dd lmZ G d
� d� Z G d� d
e e� Z G d� dej* � Z G d� dej. � Zy)z&
Tests for L{twisted.runner.procmon}.
� N)�ProcessDone�ProcessExitedAlready�ProcessTerminated)�Clock)�
MemoryReactor)�globalLogPublisher)�Failure)�LoggingProtocol�ProcessMonitor)�unittestc �8 � e Zd ZdZdZdZdZ dd�Zd� Zd� Z y)�DummyProcessa
An incomplete and fake L{IProcessTransport} implementation for testing how
L{ProcessMonitor} behaves when its monitored processes exit.
@ivar _terminationDelay: the delay in seconds after which the DummyProcess
will appear to exit when it receives a TERM signal
� Nc � � || _ || _ || _ || _ || _ || _ || _ || _ | | _ |
| _ y �N)
�proto�_reactor�_executable�_args�_environment�_path�_uid�_gid�_usePTY� _childFDs)�self�reactor�
executable�args�environment�pathr �uid�gid�usePTY�childFDss �B/usr/lib/python3/dist-packages/twisted/runner/test/test_procmon.py�__init__zDummyProcess.__init__ sL � � ��
���
�%�����
�'�����
��� ��� ����!��� c �� � | j dfdd�}| j �
t � �||v r5|| \ }}| j j || j
|� | _ yy)a�
A partial implementation of signalProcess which can only handle TERM and
KILL signals.
- When a TERM signal is given, the dummy process will appear to exit
after L{DummyProcess._terminationDelay} seconds with exit code 0
- When a KILL signal is given, the dummy process will appear to exit
immediately with exit code 1.
@param signalID: The signal name or number to be issued to the process.
@type signalID: C{str}
r �r r )�TERM�KILLN)�_terminationDelay�pidr r � callLater�processEnded�_signalHandler)r �signalID�params�delay�statuss r&