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.
Intro
Opening this PR for some early feedback and discussion. Originally I raised the issue (#341) under my other account (@ac-astuartkregor).
Important considerations
It occurred to me that some folks might be using the existing functionality in their tests. Therefore this PR could cause breakages if they are already reliant on the response status being set, rather than having to rescue the exception in their code.
What's been addressed?
I have looked at the storage requests and found any instances where a mock was setting a status code but not raising an Excon::Error of the appropriate flavour. The changes made have been verified against the actual result received when Fog is not in mock mode. Extra tests have been added to verify the success and failure cases of the various requests, in particular the
get_object
andhead_object
requests.What's left to discuss?
I'd like to know what people feel the scope of this PR should be. For example, should other AWS mocks be examined for accuracy as well? Should mock accuracy outside of exceptions vs response status be considered?