mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
added test for brotli request body compression
This commit is contained in:
parent
0126ea95dd
commit
402a8ad2d4
@ -66,6 +66,19 @@ module Requests
|
||||
body = json_body(response)
|
||||
assert body["brotli"], "response should be deflated"
|
||||
end
|
||||
|
||||
def test_plugin_compression_brotli_post
|
||||
client = HTTPX.plugin(:"compression/brotli")
|
||||
uri = build_uri("/post")
|
||||
response = client.headers("content-encoding" => "br")
|
||||
.post(uri, body: "a" * 8012)
|
||||
verify_status(response.status, 200)
|
||||
body = json_body(response)
|
||||
verify_header(body["headers"], "Content-Type", "application/octet-stream")
|
||||
compressed_data = body["data"]
|
||||
assert body["data"].bytesize < 8012, "body hasn't been compressed"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user