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

Function test_blame_for_line

test/test_blame.py:107–121  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

105
106
107def test_blame_for_line(testrepo: Repository) -> None:
108 blame = testrepo.blame(PATH)
109
110 for i, line in zip(range(0, 2), range(1, 3)):
111 hunk = blame.for_line(line)
112
113 assert hunk.lines_in_hunk == 1
114 assert HUNKS[i][0] == hunk.final_commit_id
115 assert HUNKS[i][1] == hunk.final_start_line_number
116 assert HUNKS[i][2] == hunk.final_committer
117 assert HUNKS[i][0] == hunk.orig_commit_id
118 assert hunk.orig_path == PATH
119 assert HUNKS[i][1] == hunk.orig_start_line_number
120 assert HUNKS[i][2] == hunk.orig_committer
121 assert HUNKS[i][3] == hunk.boundary
122
123
124def test_blame_with_invalid_line(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

blameMethod · 0.80
for_lineMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…