# HG changeset patch # User Mads Kiilerich # Date 2017-08-28 05:25:39 # Node ID 01c216ba7e37296c24423168148117e2bdad5c2a # Parent 2f35bd7b97aafd7ffcc0f464fbca476721da03c7 tests: fix test failure after 3c1cdd1c1736 The hashes that apparently only were used for toggling commit messages were also used by tests. This change could seem to remove some test coverage, but the removed sha check is covered by the changeset_hash check a few lines later. diff --git a/kallithea/tests/functional/test_compare.py b/kallithea/tests/functional/test_compare.py --- a/kallithea/tests/functional/test_compare.py +++ b/kallithea/tests/functional/test_compare.py @@ -6,8 +6,8 @@ from kallithea.tests.fixture import Fixt fixture = Fixture() -def _commit_div(sha, msg): - return """
%s
""" % (sha, msg) +def _commit_ref(sha, msg): + return '''
%s
''' % msg class TestCompareController(TestController): @@ -65,8 +65,8 @@ class TestCompareController(TestControll response.mustcontain("""Showing 2 commits""") response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs1.raw_id, 'commit2')) - response.mustcontain(_commit_div(cs2.raw_id, 'commit3')) + response.mustcontain(_commit_ref(cs1.raw_id, 'commit2')) + response.mustcontain(_commit_ref(cs2.raw_id, 'commit3')) response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) @@ -116,8 +116,8 @@ class TestCompareController(TestControll response.mustcontain("""Showing 2 commits""") response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs1.raw_id, 'commit2')) - response.mustcontain(_commit_div(cs2.raw_id, 'commit3')) + response.mustcontain(_commit_ref(cs1.raw_id, 'commit2')) + response.mustcontain(_commit_ref(cs2.raw_id, 'commit3')) response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) @@ -175,8 +175,8 @@ class TestCompareController(TestControll response.mustcontain("""Showing 2 commits""") response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs1.raw_id, 'commit2')) - response.mustcontain(_commit_div(cs2.raw_id, 'commit3')) + response.mustcontain(_commit_ref(cs1.raw_id, 'commit2')) + response.mustcontain(_commit_ref(cs2.raw_id, 'commit3')) response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) @@ -234,8 +234,8 @@ class TestCompareController(TestControll response.mustcontain("""Showing 2 commits""") response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs1.raw_id, 'commit2')) - response.mustcontain(_commit_div(cs2.raw_id, 'commit3')) + response.mustcontain(_commit_ref(cs1.raw_id, 'commit2')) + response.mustcontain(_commit_ref(cs2.raw_id, 'commit3')) response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) @@ -302,9 +302,9 @@ class TestCompareController(TestControll response.mustcontain("""Showing 3 commits""") response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs2.raw_id, 'commit3')) - response.mustcontain(_commit_div(cs3.raw_id, 'commit4')) - response.mustcontain(_commit_div(cs4.raw_id, 'commit5')) + response.mustcontain(_commit_ref(cs2.raw_id, 'commit3')) + response.mustcontain(_commit_ref(cs3.raw_id, 'commit4')) + response.mustcontain(_commit_ref(cs4.raw_id, 'commit5')) response.mustcontain("""r2:%s""" % (repo1.repo_name, cs2.raw_id, cs2.short_id)) response.mustcontain("""r3:%s""" % (repo1.repo_name, cs3.raw_id, cs3.short_id)) @@ -368,9 +368,9 @@ class TestCompareController(TestControll response.mustcontain("""Showing 3 commits""") response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") - response.mustcontain(_commit_div(cs3.raw_id, 'commit4')) - response.mustcontain(_commit_div(cs4.raw_id, 'commit5')) - response.mustcontain(_commit_div(cs5.raw_id, 'commit6')) + response.mustcontain(_commit_ref(cs3.raw_id, 'commit4')) + response.mustcontain(_commit_ref(cs4.raw_id, 'commit5')) + response.mustcontain(_commit_ref(cs5.raw_id, 'commit6')) response.mustcontain("""r3:%s""" % (repo1.repo_name, cs3.raw_id, cs3.short_id)) response.mustcontain("""r4:%s""" % (repo1.repo_name, cs4.raw_id, cs4.short_id))