(
testrepo: Repository, old_content: str, patch_diff: Diff
)
| 134 | |
| 135 | |
| 136 | def test_diff_applies_to_index( |
| 137 | testrepo: Repository, old_content: str, patch_diff: Diff |
| 138 | ) -> None: |
| 139 | # See if patch applies |
| 140 | assert testrepo.applies(patch_diff, ApplyLocation.INDEX) |
| 141 | |
| 142 | # Ensure it was a dry run |
| 143 | assert read_content(testrepo) == old_content |
| 144 | |
| 145 | # Apply patch for real, then ensure it can't be applied again |
| 146 | testrepo.apply(patch_diff, ApplyLocation.INDEX) |
| 147 | assert not testrepo.applies(patch_diff, ApplyLocation.INDEX) |
| 148 | |
| 149 | # It can still be applied to the workdir, though |
| 150 | assert testrepo.applies(patch_diff, ApplyLocation.WORKDIR) |
| 151 | |
| 152 | |
| 153 | def test_diff_applies_to_both( |
nothing calls this directly
no test coverage detected
searching dependent graphs…