def test_hooks_present_when_all_dash_guet_hooks_are_present(self, _1, _2): git = Git(self.path_to_git) git.hooks = [ _mock_hook(join(str(self.path_to_git), 'hooks', 'pre-commit-guet')), _mock_hook(join(str(self.path_to_git), 'hooks', 'post-commit-guet')), _mock_hook(join(str(self.path_to_git), 'hooks', 'commit-msg-guet')) ] self.assertTrue(git.hooks_present())
def test_hooks_present_returns_false_if_normal_hooks_have_non_guet_content(self, _1, _2): git = Git(self.path_to_git) git.hooks = [ _mock_hook(join(str(self.path_to_git), 'hooks', 'pre-commit')), _mock_hook(join(str(self.path_to_git), 'hooks', 'post-commit'), is_guet_hook=False), _mock_hook(join(str(self.path_to_git), 'hooks', 'commit-msg')) ] self.assertFalse(git.hooks_present())
def test_hooks_present_returns_true_when_all_normal_hooks_present(self, _1, _2): git = Git(self.path_to_git) git.hooks = [ _mock_hook(join(str(self.path_to_git), 'hooks', 'pre-commit')), _mock_hook(join(str(self.path_to_git), 'hooks', 'post-commit')), _mock_hook(join(str(self.path_to_git), 'hooks', 'commit-msg')) ] self.assertTrue(git.hooks_present())
def test_hooks_present_handles_dash_hooks(self, _1, _2): git = Git(self.path_to_git) git.hooks = [ _mock_hook(join(str(self.path_to_git), 'hooks', 'post-commit'), is_guet_hook=False), _mock_hook(join(str(self.path_to_git), 'hooks', 'pre-commit-guet')), _mock_hook(join(str(self.path_to_git), 'hooks', 'post-commit-guet')), _mock_hook(join(str(self.path_to_git), 'hooks', 'commit-msg-guet')) ] self.assertTrue(git.hooks_present())