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

Function test_no_context_lines

test/test_patch.py:180–199  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

178
179
180def test_no_context_lines(testrepo: Repository) -> None:
181 old_blob = testrepo[BLOB_OLD_SHA]
182 new_blob = testrepo[BLOB_NEW_SHA]
183 assert isinstance(old_blob, Blob)
184 assert isinstance(new_blob, Blob)
185
186 patch = pygit2.Patch.create_from(
187 old_blob,
188 new_blob,
189 old_as_path=BLOB_OLD_PATH,
190 new_as_path=BLOB_NEW_PATH,
191 context_lines=0,
192 )
193
194 assert patch.text is not None
195 context_count = len(
196 [line for line in patch.text.splitlines() if line.startswith(' ')]
197 )
198
199 assert context_count == 0
200
201
202def test_patch_create_blob_blobs(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…