# HG changeset patch # User Mads Kiilerich # Date 1547693794 -3600 # Node ID 310f557d06ca3a2e624f87edaf1c11733f8f3626 # Parent b302d4254bd061397cf36933ff1b84a13ef84ccc tests: minor clean-up of test_vcs_operations test_custom_hooks_prechangegroup - the test is Mercurial only diff -r b302d4254bd0 -r 310f557d06ca kallithea/tests/other/test_vcs_operations.py --- 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 != ''