forked from urllib3/urllib3
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Relaxed h11 constraint around "pending proposal" and coming server event about upgrade. This is made to ensure near perfect compatibility against the legacy urllib3 which was based on http.client. - Fixed h11 yielding bytearray instead of bytes in rare circumstances. - Added ``docker-py`` in our CI/integration pipeline.
- Loading branch information
Showing
8 changed files
with
126 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/tests/unit/api_test.py b/tests/unit/api_test.py | ||
index 3ce127b3..cea350ee 100644 | ||
--- a/tests/unit/api_test.py | ||
+++ b/tests/unit/api_test.py | ||
@@ -330,6 +330,7 @@ class DockerApiTest(BaseAPIClientTest): | ||
content_str = json.dumps(content) | ||
content_str = content_str.encode('utf-8') | ||
body = io.BytesIO(content_str) | ||
+ body.close = lambda: None # necessary because get closed after initial preloading. | ||
|
||
# mock a stream interface | ||
raw_resp = urllib3.HTTPResponse(body=body) | ||
@@ -445,7 +446,7 @@ class UnixSocketStreamTest(unittest.TestCase): | ||
b'HTTP/1.1 200 OK\r\n' | ||
b'Transfer-Encoding: chunked\r\n' | ||
b'\r\n' | ||
- ) + b'\r\n'.join(lines) | ||
+ ) + b'\r\n'.join(lines) + b'\r\n' # fix invalid chunked: missing extraneous RC+LF | ||
|
||
with APIClient( | ||
base_url=f"http+unix://{self.socket_file}", | ||
@@ -460,9 +461,11 @@ class UnixSocketStreamTest(unittest.TestCase): | ||
if i == 4: | ||
raise e | ||
|
||
- assert list(stream) == [ | ||
+ # assert assume that sock will yield on each chunk | ||
+ # but not necessarily true. | ||
+ assert b"".join(list(stream)) == b"".join([ | ||
str(i).encode() for i in range(50) | ||
- ] | ||
+ ]) | ||
|
||
|
||
class TCPSocketStreamTest(unittest.TestCase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file is protected via CODEOWNERS | ||
from __future__ import annotations | ||
|
||
__version__ = "2.8.903" | ||
__version__ = "2.8.904" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters