(
testrepo: Repository, old_content: str, patch_diff: Diff
)
| 151 | |
| 152 | |
| 153 | def test_diff_applies_to_both( |
| 154 | testrepo: Repository, old_content: str, patch_diff: Diff |
| 155 | ) -> None: |
| 156 | # See if patch applies |
| 157 | assert testrepo.applies(patch_diff, ApplyLocation.BOTH) |
| 158 | |
| 159 | # Ensure it was a dry run |
| 160 | assert read_content(testrepo) == old_content |
| 161 | |
| 162 | # Apply patch for real, then ensure it can't be applied again |
| 163 | testrepo.apply(patch_diff, ApplyLocation.BOTH) |
| 164 | assert not testrepo.applies(patch_diff, ApplyLocation.BOTH) |
| 165 | assert not testrepo.applies(patch_diff, ApplyLocation.WORKDIR) |
| 166 | assert not testrepo.applies(patch_diff, ApplyLocation.INDEX) |
| 167 | |
| 168 | |
| 169 | def test_applies_error( |
nothing calls this directly
no test coverage detected
searching dependent graphs…