
    Yf

                     `    d Z ddlmZ ddlmZ ddlmZ ddlm	Z	  G d de	j
                  ZdS )	z)
Tests for L{twisted.runner.procmontap}.
    )
UsageError)
procmontap)ProcessMonitor)unittestc                   J    e Zd ZdZddZddZddZddZddZdd	Z	dd
Z
dS )ProcessMonitorTapTestsz]
    Tests for L{twisted.runner.procmontap}'s option parsing and makeService
    method.
    returnNc                 n    t          j                    }|                     t          |j        g            dS )z>
        The command line arguments must be provided.
        N)tapOptionsassertRaisesr   parseOptionsselfopts     U/var/www/html/env/lib/python3.11/site-packages/twisted/runner/test/test_procmontap.pytest_commandLineRequiredz/ProcessMonitorTapTests.test_commandLineRequired   s0     kmm*c&6;;;;;    c                     t          j                    }|                    g d           |                     |d         d           dS )za
        The threshold option is recognised as a parameter and coerced to
        float.
        )z--threshold7.5foo	threshold      @Nr   r   r   assertEqualr   s     r   test_thresholdz%ProcessMonitorTapTests.test_threshold   sK    
 kmm666777[)3/////r   c                     t          j                    }|                    g d           |                     |d         d           dS )zX
        The killtime option is recognised as a parameter and coerced to float.
        )z
--killtimer   r   killtimer   Nr   r   s     r   test_killTimez$ProcessMonitorTapTests.test_killTime$   sJ     kmm555666Z#.....r   c                     t          j                    }|                    g d           |                     |d         d           dS )zg
        The minrestartdelay option is recognised as a parameter and coerced to
        float.
        )z--minrestartdelayr   r   minrestartdelayr   Nr   r   s     r   test_minRestartDelayz+ProcessMonitorTapTests.test_minRestartDelay,   L    
 kmm<<<===./55555r   c                     t          j                    }|                    g d           |                     |d         d           dS )zg
        The maxrestartdelay option is recognised as a parameter and coerced to
        float.
        )z--maxrestartdelayr   r   maxrestartdelayr   Nr   r   s     r   test_maxRestartDelayz+ProcessMonitorTapTests.test_maxRestartDelay5   r#   r   c                 8   t          j                    }|                    dg           |                     |d         d           |                     |d         d           |                     |d         d           |                     |d         d           d	S )
z8
        The parameters all have default values
        r   r      r      r!   r%   i  Nr   r   s     r   test_parameterDefaultsz-ProcessMonitorTapTests.test_parameterDefaults>   s     kmm%!!![)1---Z!,,,./333./66666r   c                     t          j                    }|                    g d           t          j        |          }|                     |t
                     |                     d|j                   dS )zP
        The command line gets added as a process to the ProcessMontor.
        )pingz-c3z8.8.8.8zping -c 3 8.8.8.8N)r   r   r   makeServiceassertIsInstancer   assertIn	processes)r   r   ss      r   test_makeServicez'ProcessMonitorTapTests.test_makeServiceI   sl     kmm777888OC  a000)1;77777r   )r	   N)__name__
__module____qualname____doc__r   r   r   r"   r&   r*   r3    r   r   r   r      s         
< < < <0 0 0 0/ / / /6 6 6 66 6 6 6	7 	7 	7 	78 8 8 8 8 8r   r   N)r7   twisted.python.usager   twisted.runnerr   r   twisted.runner.procmonr   twisted.trialr   TestCaser   r8   r   r   <module>r>      s     , + + + + + , , , , , , 1 1 1 1 1 1 " " " " " "C8 C8 C8 C8 C8X. C8 C8 C8 C8 C8r   