Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update responses mock for etag test #277

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

yjabri
Copy link
Contributor

@yjabri yjabri commented Oct 9, 2023

Description

It was brought up in #275 that a test was failing. The reason appears to be because the response was passing {} back in a 304 which requests doesn't like. This behavior is consistent with RFC 7232 - 4.1 304 Not Modified i.e. a 304 should not have a body. Another way to confirm this is the root cause is to note the exception

requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(2 bytes read, -2 more expected)', IncompleteRead(2 bytes read, -2 more expected))

points out it read two bytes ({}) but expected nothing.

Fixes #275

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • Unit tests
  • Spec Tests
  • Integration tests / Manual Tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@yjabri yjabri changed the title fix: update response mock for etag test fix: update responses mock for etag test Oct 9, 2023
@coveralls
Copy link

Coverage Status

coverage: 96.878% (+0.1%) from 96.767% when pulling 07524a8 on yjabri:fix-etag-test into 7a3b6d3 on Unleash:main.

@yjabri yjabri marked this pull request as ready for review October 9, 2023 22:36
Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is great! 🙌🏼 I'm a little surprised at how simple it really was, but I guess we just didn't dig deep enough earlier 😅 Looks good to me!

@Tymek Tymek merged commit 32d2f73 into Unleash:main Oct 20, 2023
20 checks passed
@Tymek
Copy link
Member

Tymek commented Oct 20, 2023

Thanks you very much for contributing! Since it's related to testing only new release is not needed. Happy Hacktoberfest! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

ETag test failing
4 participants