MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_hunk_content

Function test_hunk_content

test/test_diff.py:366–375  ·  view source on GitHub ↗
(barerepo: Repository)

Source from the content-addressed store, hash-verified

364
365
366def test_hunk_content(barerepo: Repository) -> None:
367 commit_a = barerepo[COMMIT_SHA1_1]
368 commit_b = barerepo[COMMIT_SHA1_2]
369 patch = commit_a.tree.diff_to_tree(commit_b.tree)[0]
370 assert patch is not None
371 hunk = patch.hunks[0]
372 lines = (f'{x.origin} {x.content}' for x in hunk.lines)
373 assert HUNK_EXPECTED == ''.join(lines)
374 for line in hunk.lines:
375 assert line.content == line.raw_content.decode()
376
377
378def test_find_similar(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

diff_to_treeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…