test_main.py 文件源码

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

项目:docker-ci-deploy 作者: praekeltfoundation 项目源码 文件源码
def test_semver_precision_requires_version_semver(self, capfd):
        """
        When the main function is given the `--semver-precision` option but no
        `--version-semver` option, it should exit with a return code of 2 and
        inform the user of the missing option.
        """
        with ExpectedException(SystemExit, MatchesStructure(code=Equals(2))):
            main(['--semver-precision', '2', 'test-image:abc'])

        out, err = capfd.readouterr()
        assert_that(out, Equals(''))
        assert_that(err, MatchesRegex(
            r'.*error: the --semver-precision option requires '
            r'--version-semver$',
            re.DOTALL
        ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号