mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54: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
|
|
@ -33,19 +33,14 @@ def test_changes_to_root_of_git_dir(git_dir_with_directory):
|
|||
assert os.getcwd() == git_dir_with_directory
|
||||
|
||||
|
||||
def test_hooks_workspace_path():
|
||||
runner = Runner('foo/bar')
|
||||
expected_path = os.path.join('foo/bar', C.HOOKS_WORKSPACE)
|
||||
assert runner.hooks_workspace_path == expected_path
|
||||
|
||||
|
||||
def test_config_file_path():
|
||||
runner = Runner('foo/bar')
|
||||
expected_path = os.path.join('foo/bar', C.CONFIG_FILE)
|
||||
assert runner.config_file_path == expected_path
|
||||
|
||||
|
||||
def test_repositories(consumer_repo):
|
||||
def test_repositories(consumer_repo, mock_out_store_directory):
|
||||
# TODO: make this not have external deps
|
||||
runner = Runner(consumer_repo)
|
||||
assert len(runner.repositories) == 2
|
||||
assert [repo.repo_url for repo in runner.repositories] == [
|
||||
|
|
@ -60,7 +55,7 @@ def test_pre_commit_path():
|
|||
assert runner.pre_commit_path == expected_path
|
||||
|
||||
|
||||
def test_cmd_runner():
|
||||
def test_cmd_runner(mock_out_store_directory):
|
||||
runner = Runner('foo/bar')
|
||||
ret = runner.cmd_runner
|
||||
assert ret.prefix_dir == os.path.join('foo/bar', C.HOOKS_WORKSPACE) + '/'
|
||||
assert ret.prefix_dir == os.path.join(mock_out_store_directory) + '/'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue