Mercurial > kallithea
changeset 5610:eb072b2cfa18
tests: run git diff tests using the git diff parser
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 25 Dec 2015 13:50:37 +0100 |
parents | ada6571a6d27 |
children | 82ed7ad0dc48 |
files | kallithea/lib/diffs.py kallithea/tests/models/test_diff_parsers.py |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/diffs.py Sun Oct 04 20:43:12 2015 +0200 +++ b/kallithea/lib/diffs.py Fri Dec 25 13:50:37 2015 +0100 @@ -364,7 +364,7 @@ groups = match.groupdict() rest = diff_chunk[match.end():] if rest and not rest.startswith('@') and not rest.startswith('literal ') and not rest.startswith('delta '): - raise Exception('cannot parse diff header: %r followed by %r' % (diff_chunk[:match.end()], rest[:1000])) + raise Exception('cannot parse %s diff header: %r followed by %r' % (self.vcs, diff_chunk[:match.end()], rest[:1000])) difflines = imap(self._escaper, re.findall(r'.*\n|.+$', rest)) # don't split on \r as str.splitlines do return groups, difflines
--- a/kallithea/tests/models/test_diff_parsers.py Sun Oct 04 20:43:12 2015 +0200 +++ b/kallithea/tests/models/test_diff_parsers.py Fri Dec 25 13:50:37 2015 +0100 @@ -276,7 +276,10 @@ @parameterized.expand([(x,) for x in DIFF_FIXTURES]) def test_diff(self, diff_fixture): diff = fixture.load_resource(diff_fixture, strip=False) - diff_proc = DiffProcessor(diff) + vcs = 'hg' + if diff_fixture.startswith('git_'): + vcs = 'git' + diff_proc = DiffProcessor(diff, vcs=vcs) diff_proc_d = diff_proc.prepare() data = [(x['filename'], x['operation'], x['stats']) for x in diff_proc_d] expected_data = DIFF_FIXTURES[diff_fixture]