diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2022-12-21 11:29:07 +0100 |
---|---|---|
committer | Joris Roovers <joris.roovers@gmail.com> | 2022-12-22 08:35:10 +0000 |
commit | 1cf68925cbcf3632c42cd5b02c78c2b477c5488d (patch) | |
tree | b81bcef9dc3a0e43ce560811749d347c2367d766 /qa | |
parent | 3b2a10db99d881c6b7942bdf4c5c6ee5378dc359 (diff) |
Integration tests: fix 2 hooktests on windows (#397)
This only leaves 3 hook tests that are still failing on windows.
Relates to #93
Diffstat (limited to 'qa')
-rw-r--r-- | qa/test_hooks.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/qa/test_hooks.py b/qa/test_hooks.py index 19edeb2..6867a35 100644 --- a/qa/test_hooks.py +++ b/qa/test_hooks.py @@ -30,18 +30,16 @@ class HookTests(BaseTestCase): # install git commit-msg hook and assert output output_installed = gitlint("install-hook", _cwd=self.tmp_git_repo) - expected_installed = ( - f"Successfully installed gitlint commit-msg hook in {self.tmp_git_repo}/.git/hooks/commit-msg\n" - ) + commit_msg_hook_path = os.path.join(self.tmp_git_repo, ".git", "hooks", "commit-msg") + expected_installed = f"Successfully installed gitlint commit-msg hook in {commit_msg_hook_path}\n" self.assertEqualStdout(output_installed, expected_installed) def tearDown(self): # uninstall git commit-msg hook and assert output output_uninstalled = gitlint("uninstall-hook", _cwd=self.tmp_git_repo) - expected_uninstalled = ( - f"Successfully uninstalled gitlint commit-msg hook from {self.tmp_git_repo}/.git/hooks/commit-msg\n" - ) + commit_msg_hook_path = os.path.join(self.tmp_git_repo, ".git", "hooks", "commit-msg") + expected_uninstalled = f"Successfully uninstalled gitlint commit-msg hook from {commit_msg_hook_path}\n" self.assertEqualStdout(output_uninstalled, expected_uninstalled) super().tearDown() @@ -171,10 +169,10 @@ class HookTests(BaseTestCase): output_installed = gitlint("install-hook", _cwd=worktree_dir) expected_hook_path = os.path.join(tmp_git_repo, ".git", "hooks", "commit-msg") - expected_msg = f"Successfully installed gitlint commit-msg hook in {expected_hook_path}\r\n" - self.assertEqual(output_installed, expected_msg) + expected_msg = f"Successfully installed gitlint commit-msg hook in {expected_hook_path}\n" + self.assertEqualStdout(output_installed, expected_msg) output_uninstalled = gitlint("uninstall-hook", _cwd=worktree_dir) expected_hook_path = os.path.join(tmp_git_repo, ".git", "hooks", "commit-msg") - expected_msg = f"Successfully uninstalled gitlint commit-msg hook from {expected_hook_path}\r\n" - self.assertEqual(output_uninstalled, expected_msg) + expected_msg = f"Successfully uninstalled gitlint commit-msg hook from {expected_hook_path}\n" + self.assertEqualStdout(output_uninstalled, expected_msg) |