Merge pull request #19 from kevinveenbirkenbach/feature/release-expect-tree
feat(release): refuse a release whose HEAD tree is not the audited one
This commit is contained in:
13 files changed
+527
-303
No files matched your search
@@ -16,6 +16,8 @@ import unittest
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import call, patch
|
||||
|
||||
from pkgmgr.actions.release import ReleaseOptions
|
||||
|
||||
|
||||
class TestReleaseCommand(unittest.TestCase):
|
||||
"""
|
||||
@@ -100,14 +102,17 @@ class TestReleaseCommand(unittest.TestCase):
|
||||
|
||||
# And run_release should be invoked once with the expected parameters.
|
||||
mock_run_release.assert_called_once_with(
|
||||
pyproject_path="pyproject.toml",
|
||||
changelog_path="CHANGELOG.md",
|
||||
release_type="minor",
|
||||
message="Close branch after minor release",
|
||||
preview=False,
|
||||
force=True,
|
||||
close=True,
|
||||
retry=False,
|
||||
ReleaseOptions(
|
||||
pyproject_path="pyproject.toml",
|
||||
changelog_path="CHANGELOG.md",
|
||||
release_type="minor",
|
||||
message="Close branch after minor release",
|
||||
preview=False,
|
||||
force=True,
|
||||
close=True,
|
||||
retry=False,
|
||||
expect_tree=None,
|
||||
)
|
||||
)
|
||||
|
||||
@patch("pkgmgr.cli.commands.release.os.path.isdir", return_value=True)
|
||||
@@ -143,20 +148,25 @@ class TestReleaseCommand(unittest.TestCase):
|
||||
"patch",
|
||||
"dummy-id",
|
||||
"--preview",
|
||||
"--expect-tree",
|
||||
"4b825dc642cb6eb9a060e54bf8d69288fbee4904",
|
||||
]
|
||||
args = self._parse_release_args(argv)
|
||||
|
||||
handle_release(args, ctx, selected)
|
||||
|
||||
mock_run_release.assert_called_once_with(
|
||||
pyproject_path="pyproject.toml",
|
||||
changelog_path="CHANGELOG.md",
|
||||
release_type="patch",
|
||||
message=None,
|
||||
preview=True,
|
||||
force=False,
|
||||
close=False,
|
||||
retry=False,
|
||||
ReleaseOptions(
|
||||
pyproject_path="pyproject.toml",
|
||||
changelog_path="CHANGELOG.md",
|
||||
release_type="patch",
|
||||
message=None,
|
||||
preview=True,
|
||||
force=False,
|
||||
close=False,
|
||||
retry=False,
|
||||
expect_tree="4b825dc642cb6eb9a060e54bf8d69288fbee4904",
|
||||
)
|
||||
)
|
||||
|
||||
@patch("pkgmgr.cli.commands.release.run_release")
|
||||
|
||||
Reference in new issue
Block a user