def test_stop(self):
"""
Test daemon stop functionality. Verifies that pidfile is being removed,
process does not exist.
"""
with open(self.pidfile) as pid_file:
pid = pid_file.read().rstrip()
result = os.system(self.cmd % (THIS_FILE_PATH, 'stop', self.pidfile))
sleep(1)
self.assertEqual(result, 0, 'Wrong return code')
self.assertFalse(psutil.pid_exists(int(pid)),
'Process with {0} pid still exists'.format(pid))
self.assertFalse(os.path.exists(self.pidfile),
'Pidfile has not been removed')
评论列表
文章目录