Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stack-setup): put hooks at the right place #549

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
20 changes: 20 additions & 0 deletions mergify_cli/tests/stack/test_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pathlib
import typing

import pytest

from mergify_cli.stack import setup
from mergify_cli.tests import utils as test_utils


async def test_setup(
git_mock: test_utils.GitMock,
tmp_path: pytest.TempdirFactory,
) -> None:
hooks_dir = typing.cast(pathlib.Path, tmp_path) / ".git" / "hooks"
hooks_dir.mkdir(parents=True)
git_mock.mock("rev-parse", "--git-path", "hooks", output=str(hooks_dir))
await setup.stack_setup()

hook = hooks_dir / "commit-msg"
assert hook.exists()