summaryrefslogtreecommitdiff
path: root/tests/test_swiftclient.py
diff options
context:
space:
mode:
authorStuart McLaren <stuart.mclaren@hp.com>2013-01-18 14:17:21 +0000
committerStuart McLaren <stuart.mclaren@hp.com>2013-06-04 16:33:18 +0000
commit790f087a67fcc0cc7730cedd1a225d58a82ddf5d (patch)
treeaf269fc89acca0a27769b18df4d6f339217adfd4 /tests/test_swiftclient.py
parent2d12f09c66e0221ba7f43cc64677c05486a42ea6 (diff)
downloadpython-swiftclient-790f087a67fcc0cc7730cedd1a225d58a82ddf5d.tar.gz
Add option to disable SSL compression
Allows optionally disabling SSL compression. This can significantly improve HTTPS upload/download performance in some cases -- in particular when the object is not compressible and you have very high network bandwidth. Implements blueprint ssl-compression. Change-Id: I1260055f9c2e83cdabfeb51aed11b3899bed4d55
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r--tests/test_swiftclient.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index aa0e159..84d165b 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -14,6 +14,7 @@
# limitations under the License.
# TODO: More tests
+import httplib
import socket
import StringIO
import testtools
@@ -123,7 +124,7 @@ class MockHttpTest(testtools.TestCase):
return_read = kwargs.get('return_read')
query_string = kwargs.get('query_string')
- def wrapper(url, proxy=None):
+ def wrapper(url, proxy=None, ssl_compression=True):
parsed, _conn = _orig_http_connection(url, proxy=proxy)
conn = fake_http_connect(*args, **kwargs)()
@@ -182,7 +183,8 @@ class TestHttpHelpers(MockHttpTest):
self.assertTrue(isinstance(conn, c.HTTPConnection))
url = 'https://www.test.com'
_junk, conn = c.http_connection(url)
- self.assertTrue(isinstance(conn, c.HTTPSConnection))
+ self.assertTrue(isinstance(conn, httplib.HTTPSConnection) or
+ isinstance(conn, c.HTTPSConnectionNoSSLComp))
url = 'ftp://www.test.com'
self.assertRaises(c.ClientException, c.http_connection, url)
@@ -775,7 +777,7 @@ class TestConnection(MockHttpTest):
def read(self, *args, **kwargs):
return ''
- def local_http_connection(url, proxy=None):
+ def local_http_connection(url, proxy=None, ssl_compression=True):
parsed = urlparse(url)
return parsed, LocalConnection()