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

Function test_diff_blobs

test/test_diff.py:465–476  ·  view source on GitHub ↗
(emptyrepo: Repository)

Source from the content-addressed store, hash-verified

463
464
465def test_diff_blobs(emptyrepo: Repository) -> None:
466 repo = emptyrepo
467 blob1 = repo.create_blob(TEXT_BLOB1.encode())
468 blob2 = repo.create_blob(TEXT_BLOB2.encode())
469 diff_default = repo.diff(blob1, blob2)
470 assert diff_default.text == PATCH_BLOBS_DEFAULT
471 diff_no_leeway = repo.diff(blob1, blob2, context_lines=0)
472 assert diff_no_leeway.text == PATCH_BLOBS_NO_LEEWAY
473 diff_one_context_line = repo.diff(blob1, blob2, context_lines=1)
474 assert diff_one_context_line.text == PATCH_BLOBS_ONE_CONTEXT_LINE
475 diff_all_together = repo.diff(blob1, blob2, context_lines=1, interhunk_lines=1)
476 assert diff_all_together.text == PATCH_BLOBS_DEFAULT
477
478
479def test_diff_unchanged_file_no_patch(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

diffMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…