Skip to content

Commit 427ccc6

Browse files
authored
fix(stack-setup): put hooks at the right place (#549)
This adds test coverage to stack_setup to ensure we don't break this again.
1 parent 29b60c1 commit 427ccc6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
File renamed without changes.

mergify_cli/tests/stack/test_setup.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pathlib
2+
import typing
3+
4+
import pytest
5+
6+
from mergify_cli.stack import setup
7+
from mergify_cli.tests import utils as test_utils
8+
9+
10+
async def test_setup(
11+
git_mock: test_utils.GitMock,
12+
tmp_path: pytest.TempdirFactory,
13+
) -> None:
14+
hooks_dir = typing.cast(pathlib.Path, tmp_path) / ".git" / "hooks"
15+
hooks_dir.mkdir(parents=True)
16+
git_mock.mock("rev-parse", "--git-path", "hooks", output=str(hooks_dir))
17+
await setup.stack_setup()
18+
19+
hook = hooks_dir / "commit-msg"
20+
assert hook.exists()

0 commit comments

Comments
 (0)