mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Implement Store. pre-commit now installs files to ~/.pre-commit
This commit is contained in:
parent
26af2cecab
commit
479eb51873
16 changed files with 457 additions and 234 deletions
34
tests/manifest_test.py
Normal file
34
tests/manifest_test.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import pytest
|
||||
|
||||
from pre_commit.manifest import Manifest
|
||||
from testing.util import get_head_sha
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def manifest(store, script_hooks_repo):
|
||||
head_sha = get_head_sha(script_hooks_repo)
|
||||
repo_path_getter = store.get_repo_path_getter(script_hooks_repo, head_sha)
|
||||
yield Manifest(repo_path_getter)
|
||||
|
||||
|
||||
def test_manifest_contents(manifest):
|
||||
# Should just retrieve the manifest contents
|
||||
assert manifest.manifest_contents == [{
|
||||
'description': '',
|
||||
'entry': 'bin/hook.sh',
|
||||
'expected_return_value': 0,
|
||||
'id': 'bash_hook',
|
||||
'language': 'script',
|
||||
'name': 'Bash hook',
|
||||
}]
|
||||
|
||||
|
||||
def test_hooks(manifest):
|
||||
assert manifest.hooks['bash_hook'] == {
|
||||
'description': '',
|
||||
'entry': 'bin/hook.sh',
|
||||
'expected_return_value': 0,
|
||||
'id': 'bash_hook',
|
||||
'language': 'script',
|
||||
'name': 'Bash hook',
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue