Ϫf bdZddlmZddlmZddlmZddlm Z Gdde jZ y) z) Tests for L{twisted.runner.procmontap}. ) UsageError) procmontap)ProcessMonitor)unittestcHeZdZdZd dZd dZd dZd dZd dZd dZ d d Z y) ProcessMonitorTapTestsz] Tests for L{twisted.runner.procmontap}'s option parsing and makeService method. Ncntj}|jt|jgy)z> The command line arguments must be provided. N)tapOptions assertRaisesr parseOptionsselfopts E/usr/lib/python3/dist-packages/twisted/runner/test/test_procmontap.pytest_commandLineRequiredz/ProcessMonitorTapTests.test_commandLineRequireds'kkm *c&6&6;c|tj}|jgd|j|ddy)za The threshold option is recognised as a parameter and coerced to float. )z --threshold7.5foo threshold@Nr r r assertEqualrs rtest_thresholdz%ProcessMonitorTapTests.test_thresholds3 kkm 67 [)3/rc|tj}|jgd|j|ddy)zX The killtime option is recognised as a parameter and coerced to float. )z --killtimerrkilltimerNrrs r test_killTimez$ProcessMonitorTapTests.test_killTime$s2kkm 56 Z#.rc|tj}|jgd|j|ddy)zg The minrestartdelay option is recognised as a parameter and coerced to float. )z--minrestartdelayrrminrestartdelayrNrrs rtest_minRestartDelayz+ProcessMonitorTapTests.test_minRestartDelay,4 kkm <= ./5rc|tj}|jgd|j|ddy)zg The maxrestartdelay option is recognised as a parameter and coerced to float. )z--maxrestartdelayrrmaxrestartdelayrNrrs rtest_maxRestartDelayz+ProcessMonitorTapTests.test_maxRestartDelay5r"rctj}|jdg|j|dd|j|dd|j|dd|j|ddy ) z8 The parameters all have default values rrrr r$iNrrs rtest_parameterDefaultsz-ProcessMonitorTapTests.test_parameterDefaults>stkkm %! [)1- Z!, ./3 ./6rctj}|jgdtj|}|j |t |j d|jy)zP The command line gets added as a process to the ProcessMontor. )pingz-c3z8.8.8.8zping -c 3 8.8.8.8N)r r r makeServiceassertIsInstancerassertIn processes)rrss rtest_makeServicez'ProcessMonitorTapTests.test_makeServiceIsOkkm 78 OOC  a0 )1;;7r)returnN) __name__ __module__ __qualname____doc__rrrr!r%r)r2rrrrs* <0/66 78rrN) r7twisted.python.usagertwisted.runnerrr twisted.runner.procmonr twisted.trialrTestCaserr8rrr>s,,,1"C8X..C8r