(
testrepo: Repository, old_content: str, patch_diff: Diff, foreign_patch_diff: Diff
)
| 167 | |
| 168 | |
| 169 | def test_applies_error( |
| 170 | testrepo: Repository, old_content: str, patch_diff: Diff, foreign_patch_diff: Diff |
| 171 | ) -> None: |
| 172 | # Try to apply a "foreign" patch that affects files that aren't in the repo; |
| 173 | # ensure we get OSError about the missing file (due to raise_error) |
| 174 | with pytest.raises(OSError): |
| 175 | testrepo.applies(foreign_patch_diff, ApplyLocation.BOTH, raise_error=True) |
| 176 | |
| 177 | # Apply a valid patch |
| 178 | testrepo.apply(patch_diff, ApplyLocation.BOTH) |
| 179 | |
| 180 | # Ensure it can't be applied again and we get an exception about it (due to raise_error) |
| 181 | with pytest.raises(pygit2.GitError): |
| 182 | testrepo.applies(patch_diff, ApplyLocation.BOTH, raise_error=True) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…