(testrepo: Repository)
| 178 | |
| 179 | |
| 180 | def 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 | |
| 202 | def test_patch_create_blob_blobs(testrepo: Repository) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…