Adding GZip support to urllib3 (#704)
* Adding GZip support to urllib3 * Adding compression documentation and example * Convert to lowercase for consistency * Moving header manipulation to __init__() * Validating headers for compression * Moving body compression out of the headers block * Don't compress if there is no body * Infer true
This commit is contained in:
@@ -32,6 +32,11 @@ class TestUrllib3Connection(TestCase):
|
||||
)
|
||||
self.assertTrue(con.use_ssl)
|
||||
|
||||
def test_http_compression(self):
|
||||
con = Urllib3HttpConnection(http_compress=True)
|
||||
self.assertTrue(con.http_compress)
|
||||
self.assertEquals(con.headers['content-encoding'], 'gzip')
|
||||
|
||||
def test_timeout_set(self):
|
||||
con = Urllib3HttpConnection(timeout=42)
|
||||
self.assertEquals(42, con.timeout)
|
||||
|
||||
Reference in New Issue
Block a user