HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/runner/test/__pycache__/test_procmontap.cpython-310.pyc
o

�b�	�@sJdZddlmZddlmZddlmZddlm	Z	Gdd�de	j
�ZdS)	z)
Tests for L{twisted.runner.procmontap}.
�)�
UsageError)�
procmontap)�ProcessMonitor)�unittestc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�ProcessMonitorTapTestsz]
    Tests for L{twisted.runner.procmontap}'s option parsing and makeService
    method.
    cCst��}|�t|jg�dS)z>
        The command line arguments must be provided.
        N)�tap�Options�assertRaisesr�parseOptions��self�opt�r�E/usr/lib/python3/dist-packages/twisted/runner/test/test_procmontap.py�test_commandLineRequiredsz/ProcessMonitorTapTests.test_commandLineRequiredcC�*t��}|�gd��|�|dd�dS)za
        The threshold option is recognised as a parameter and coerced to
        float.
        )z--threshold�7.5�foo�	threshold�@N�rrr
�assertEqualrrrr�test_threshold�z%ProcessMonitorTapTests.test_thresholdcCr)zX
        The killtime option is recognised as a parameter and coerced to float.
        )z
--killtimerr�killtimerNrrrrr�
test_killTime$sz$ProcessMonitorTapTests.test_killTimecCr)zg
        The minrestartdelay option is recognised as a parameter and coerced to
        float.
        )z--minrestartdelayrr�minrestartdelayrNrrrrr�test_minRestartDelay,rz+ProcessMonitorTapTests.test_minRestartDelaycCr)zg
        The maxrestartdelay option is recognised as a parameter and coerced to
        float.
        )z--maxrestartdelayrr�maxrestartdelayrNrrrrr�test_maxRestartDelay5rz+ProcessMonitorTapTests.test_maxRestartDelaycCsXt��}|�dg�|�|dd�|�|dd�|�|dd�|�|dd�d	S)
z8
        The parameters all have default values
        rr�r�rriNrrrrr�test_parameterDefaults>sz-ProcessMonitorTapTests.test_parameterDefaultscCs>t��}|�gd��t�|�}|�|t�|�d|j�dS)zP
        The command line gets added as a process to the ProcessMontor.
        )�pingz-c�3z8.8.8.8zping -c 3 8.8.8.8N)rrr
�makeService�assertIsInstancer�assertIn�	processes)rr
�srrr�test_makeServiceIs

z'ProcessMonitorTapTests.test_makeServiceN)�__name__�
__module__�__qualname__�__doc__rrrrrr"r*rrrrrs			rN)r.�twisted.python.usager�twisted.runnerrr�twisted.runner.procmonr�
twisted.trialr�TestCaserrrrr�<module>s