def test_commit_msg_hook_path(self): lint_config = LintConfig() lint_config.target = self.SAMPLES_DIR expected_path = os.path.join(self.SAMPLES_DIR, COMMIT_MSG_HOOK_DST_PATH) path = GitHookInstaller.commit_msg_hook_path(lint_config) self.assertEqual(path, expected_path)
def test_commit_msg_hook_path(self, git_hooks_dir): git_hooks_dir.return_value = os.path.join(u"/föo", u"bar") lint_config = LintConfig() lint_config.target = self.SAMPLES_DIR expected_path = os.path.join(git_hooks_dir.return_value, COMMIT_MSG_HOOK_DST_PATH) path = GitHookInstaller.commit_msg_hook_path(lint_config) git_hooks_dir.assert_called_once_with(self.SAMPLES_DIR) self.assertEqual(path, expected_path)
def test_commit_msg_hook_path(self): lint_config = LintConfig(target="/foo/bar") expected_path = os.path.join("/foo/bar", COMMIT_MSG_HOOK_DST_PATH) path = GitHookInstaller.commit_msg_hook_path(lint_config) self.assertEqual(path, expected_path)