summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/common/certs.py3
-rw-r--r--src/leap/common/http.py3
-rw-r--r--src/leap/common/tests/test_http.py18
3 files changed, 17 insertions, 7 deletions
diff --git a/src/leap/common/certs.py b/src/leap/common/certs.py
index c8e0743..37ede8e 100644
--- a/src/leap/common/certs.py
+++ b/src/leap/common/certs.py
@@ -192,6 +192,7 @@ def get_compatible_ssl_context_factory(cert_path=None):
return policy
else:
raise Exception(("""
- Twisted 14.0.2 is needed in order to have secure Client Web SSL Contexts, not %s
+ Twisted 14.0.2 is needed in order to have secure
+ Client Web SSL Contexts, not %s
See: http://twistedmatrix.com/trac/ticket/7647
""") % (twisted.version.base()))
diff --git a/src/leap/common/http.py b/src/leap/common/http.py
index 8e8d3d9..1e7ded7 100644
--- a/src/leap/common/http.py
+++ b/src/leap/common/http.py
@@ -120,7 +120,8 @@ class HTTPClient(object):
maxPersistentPerHost=10
)
- def __init__(self, cert_file=None, timeout=DEFAULT_HTTP_TIMEOUT, pool=None):
+ def __init__(self, cert_file=None,
+ timeout=DEFAULT_HTTP_TIMEOUT, pool=None):
"""
Init the HTTP client
diff --git a/src/leap/common/tests/test_http.py b/src/leap/common/tests/test_http.py
index a586fd1..f44550f 100644
--- a/src/leap/common/tests/test_http.py
+++ b/src/leap/common/tests/test_http.py
@@ -43,8 +43,11 @@ class HTTPClientTest(BaseLeapTest):
def test_agents_sharing_pool_by_default(self):
client = http.HTTPClient()
client2 = http.HTTPClient(TEST_CERT_PEM)
- self.assertNotEquals(client._agent, client2._agent, "Expected dedicated agents")
- self.assertEquals(client._agent._pool, client2._agent._pool, "Pool was not reused by default")
+ self.assertNotEquals(
+ client._agent, client2._agent, "Expected dedicated agents")
+ self.assertEquals(
+ client._agent._pool, client2._agent._pool,
+ "Pool was not reused by default")
def test_agent_can_have_dedicated_custom_pool(self):
custom_pool = http._HTTPConnectionPool(
@@ -54,14 +57,19 @@ class HTTPClientTest(BaseLeapTest):
persistent=False
)
self.assertEquals(custom_pool.maxPersistentPerHost, 42,
- "Custom persistent connections limit is not being respected")
+ "Custom persistent connections "
+ "limit is not being respected")
self.assertFalse(custom_pool.persistent,
"Custom persistence is not being respected")
default_client = http.HTTPClient()
custom_client = http.HTTPClient(pool=custom_pool)
- self.assertNotEquals(default_client._agent, custom_client._agent, "No agent reuse is expected")
- self.assertEquals(custom_pool, custom_client._agent._pool, "Custom pool usage was not respected")
+ self.assertNotEquals(
+ default_client._agent, custom_client._agent,
+ "No agent reuse is expected")
+ self.assertEquals(
+ custom_pool, custom_client._agent._pool,
+ "Custom pool usage was not respected")
if __name__ == "__main__":
unittest.main()