(
testrepo: Repository, old_content: str, patch_diff: Diff
)
| 117 | |
| 118 | |
| 119 | def test_diff_applies_to_workdir( |
| 120 | testrepo: Repository, old_content: str, patch_diff: Diff |
| 121 | ) -> None: |
| 122 | # See if patch applies |
| 123 | assert testrepo.applies(patch_diff, ApplyLocation.WORKDIR) |
| 124 | |
| 125 | # Ensure it was a dry run |
| 126 | assert read_content(testrepo) == old_content |
| 127 | |
| 128 | # Apply patch for real, then ensure it can't be applied again |
| 129 | testrepo.apply(patch_diff, ApplyLocation.WORKDIR) |
| 130 | assert not testrepo.applies(patch_diff, ApplyLocation.WORKDIR) |
| 131 | |
| 132 | # It can still be applied to the index, though |
| 133 | assert testrepo.applies(patch_diff, ApplyLocation.INDEX) |
| 134 | |
| 135 | |
| 136 | def test_diff_applies_to_index( |
nothing calls this directly
no test coverage detected
searching dependent graphs…