changeset 7743:310f557d06ca

tests: minor clean-up of test_vcs_operations test_custom_hooks_prechangegroup - the test is Mercurial only
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 17 Jan 2019 03:56:34 +0100
parents b302d4254bd0
children b5fe8bc0b939
files kallithea/tests/other/test_vcs_operations.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/other/test_vcs_operations.py	Fri Jun 07 03:37:07 2019 +0200
+++ b/kallithea/tests/other/test_vcs_operations.py	Thu Jan 17 03:56:34 2019 +0100
@@ -482,7 +482,7 @@
 
     @parametrize_vcs_test_hg # git hooks doesn't work like hg hooks
     def test_custom_hooks_prechangegroup(self, testhook_cleanup, webserver, testfork, vt):
-        # set prechangegroup to failing hook (returns True)
+        # set prechangegroup to failing hook (returns exit code 1)
         Ui.create_or_update_hook('prechangegroup.testhook', 'python:kallithea.tests.fixture.failing_test_hook')
         Session().commit()
         # clone repo
@@ -504,11 +504,10 @@
         Session().commit()
         # re-try to push
         stdout, stderr = Command(dest_dir).execute('%s push' % vt.repo_type, clone_url, ignoreReturnCode=True)
-        if vt.repo_type == 'hg':
+        if vt is HgHttpVcsTest:
             # like with 'hg serve...' 'HTTP Error 500: INTERNAL SERVER ERROR' should be returned
             assert 'HTTP Error 500: INTERNAL SERVER ERROR' in stderr
-        elif vt.repo_type == 'git':
-            assert 'exception_test_hook threw an exception' in stderr
+        else: assert False
         # there are still outgoing changesets
         stdout, stderr = _check_outgoing(vt.repo_type, dest_dir, clone_url)
         assert stdout != ''