test_python_procman.py (1416:4d5c9bae8892) test_python_procman.py (1453:71af60a59338)
1import re
2import time
3import subprocess
4import unittest
5from unit.applications.lang.python import TestApplicationPython
6
7
8class TestPythonProcman(TestApplicationPython):

--- 182 unchanged lines hidden (view full) ---

191 self.assertIn(
192 'error', self.conf({"spare": -1}, self.app_proc), 'negative spare',
193 )
194 self.assertIn(
195 'error', self.conf({"max": -1}, self.app_proc), 'negative max',
196 )
197 self.assertIn(
198 'error',
1import re
2import time
3import subprocess
4import unittest
5from unit.applications.lang.python import TestApplicationPython
6
7
8class TestPythonProcman(TestApplicationPython):

--- 182 unchanged lines hidden (view full) ---

191 self.assertIn(
192 'error', self.conf({"spare": -1}, self.app_proc), 'negative spare',
193 )
194 self.assertIn(
195 'error', self.conf({"max": -1}, self.app_proc), 'negative max',
196 )
197 self.assertIn(
198 'error',
199 self.conf({"idle_timeout": -1}, self.app_proc,),
199 self.conf({"idle_timeout": -1}, self.app_proc),
200 'negative idle_timeout',
201 )
202 self.assertIn(
203 'error',
204 self.conf({"spare": 2}, self.app_proc),
205 'spare gt max default',
206 )
207 self.assertIn(
208 'error',
200 'negative idle_timeout',
201 )
202 self.assertIn(
203 'error',
204 self.conf({"spare": 2}, self.app_proc),
205 'spare gt max default',
206 )
207 self.assertIn(
208 'error',
209 self.conf({"spare": 2, "max": 1}, self.app_proc,),
209 self.conf({"spare": 2, "max": 1}, self.app_proc),
210 'spare gt max',
211 )
212 self.assertIn(
213 'error',
210 'spare gt max',
211 )
212 self.assertIn(
213 'error',
214 self.conf({"spare": 0, "max": 0}, self.app_proc,),
214 self.conf({"spare": 0, "max": 0}, self.app_proc),
215 'max zero',
216 )
217
218 def stop_all(self):
219 self.conf({"listeners": {}, "applications": {}})
220
221 self.assertEqual(len(self.pids_for_process()), 0, 'stop all')
222
223
224if __name__ == '__main__':
225 TestPythonProcman.main()
215 'max zero',
216 )
217
218 def stop_all(self):
219 self.conf({"listeners": {}, "applications": {}})
220
221 self.assertEqual(len(self.pids_for_process()), 0, 'stop all')
222
223
224if __name__ == '__main__':
225 TestPythonProcman.main()