Make the pre-commit actually executable. Closes #32

This commit is contained in:
Anthony Sottile 2014-03-18 21:40:08 -07:00
parent 601e643960
commit 6188903ed7
2 changed files with 8 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import os
import pytest
import stat
from plumbum import local
from pre_commit import git
@ -25,6 +26,10 @@ def test_get_pre_commit_path(empty_git_dir):
def test_create_pre_commit(empty_git_dir):
git.create_pre_commit()
assert len(open(git.get_pre_commit_path(), 'r').read()) > 0
stat_result = os.stat(git.get_pre_commit_path())
assert stat_result.st_mode & stat.S_IXUSR
assert stat_result.st_mode & stat.S_IXGRP
assert stat_result.st_mode & stat.S_IXOTH
def test_remove_pre_commit(empty_git_dir):