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
))
评论列表
文章目录