test_main.py 文件源码

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

项目:aws-ec2rescue-linux 作者: awslabs 项目源码 文件源码
def test_main_help(self):
        """Test that help returns True and get_help's output matches the expected length."""
        sys.argv = ["ec2rl", "help"]
        with contextlib.redirect_stdout(self.output):
            self.assertTrue(self.ec2rl.help())
        self.assertTrue(self.output.getvalue().startswith("ec2rl:  A framework for executing diagnostic and troublesh"))
        self.assertTrue(self.output.getvalue().endswith("- enables debug level logging\n\n"))
        self.assertEqual(len(self.output.getvalue()), 8438)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号