Allow files.PutFileReturnsDifferentVersion to pass when version is based on file content #90
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.
It feels like the validator is dependent on the order the tests are run. If we use the SHA256 (or any file content based method) as a X-WOPI-ItemVersion and run each test in isolation files.PutFileReturnsDifferentVersion passes fine. It doesn't pass when you run all the tests together because a previous test (files.PutFileReturnsVersion) runs and sets the file to WordSimpleDocument. Then the first request in files.PutFileReturnsDifferentVersion also puts the same file (WordSimpleDocument) but then checks that the X-WOPI-ItemVersion has changed. Since it's the same file the hash doesn't change and the test is marked a failure.
The proposed fix is to not do the first check (and thus the CheckFileInfo call doesn't need to be made) and simply rely on the second PUT request to check if the requirements of the tests are accounted for.