Add option to generate test
operations in diff
#154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR adds a new option for generating patches -
generate_test_ops
- that adds atest
operation before everyremove
andreplace
operation. This allows for generating patches that have stronger data integrity characteristics. It is also a useful option if you care about knowing what the data was pre-patch (this is important for our use-case). The flag defaults toFalse
to keep the default behavior the same.I have modified the test suite to run the
MakePatchTestCase
twice - once withgenerate_test_ops=True
and once withgenerate_test_ops=False
. Patches are still applying properly in both cases so I am confident that all is well.Please let me know if there's anything else that needs to be done as part of this PR.
Thanks!