Skip to content

Commit

Permalink
fix(stack-setup): put hooks at the right place (#549)
Browse files Browse the repository at this point in the history
This adds test coverage to stack_setup to ensure we don't break this
again.
  • Loading branch information
sileht authored Nov 20, 2024
1 parent 29b60c1 commit 427ccc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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()

0 comments on commit 427ccc6

Please sign in to comment.