test_daemon.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:OneDrive-L 作者: epam 项目源码 文件源码
def test_start(self):
        """
        Verifies that pidfile is created, process exists, pidfile is not empty.
        """

        result = os.system(self.cmd % (THIS_FILE_PATH, 'start', self.pidfile))
        sleep(1)

        self.assertTrue(os.path.exists(self.pidfile),
                        'Pidfile has not been created')

        with open(self.pidfile) as pid_file:
            pid = pid_file.read().rstrip()

        self.assertTrue(pid, 'Pidfile is empty')

        self.assertTrue(psutil.pid_exists(int(pid)),
                        'Process with specified pid does not exist')

        self.assertEqual(result, 0, 'Wrong return code')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号