Closed Tymek closed 1 year ago
I believe the problem is the argument json={}
in the responses.add(...)
. According to RFC 7232 - 4.1 304 Not Modified
A 304 response cannot contain a message-body; it is always terminated by the first empty line after the header field
I think that's why calling session.get
in the test raises
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(2 bytes read, -2 more expected)', IncompleteRead(2 bytes read, -2 more expected))
The two bytes being {}
. I validated that removing the argument and changing the call to
responses.add(
responses.GET, PROJECT_URL, status=304, headers={"etag": ETAG_VALUE}
)
makes the test pass.
@yjabri If you confirmed that it will make tests pass, PRs are welcome 👍🏻 You can try tests in CI with a PR Draft
@Tymek Does this PR look okay to you? I believe it addresses the problem raised.
Describe the bug ETag test in
tests/unit_tests/api/test_feature.py:92
is broken.To Reproduce Steps to reproduce the behavior:
Additional context It's skipping this test was pushed forward in time multiple times. Let's track this issue and attempts to solve it here.