[style] more pep8 cleanup
authorKali Kaneko <kali@leap.se>
Tue, 28 Jul 2015 15:41:32 +0000 (11:41 -0400)
committerKali Kaneko <kali@leap.se>
Tue, 28 Jul 2015 15:41:32 +0000 (11:41 -0400)
pkg/utils.py
src/leap/common/certs.py
src/leap/common/http.py
src/leap/common/tests/test_http.py

index deace14..521cd4e 100644 (file)
@@ -58,9 +58,9 @@ def parse_requirements(reqfiles=['requirements.txt',
         if re.match(r'\s*-e\s+', line):
             pass
             # do not try to do anything with externals on vcs
-            #requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1',
-                                #line))
-        # http://foo.bar/baz/foobar/zipball/master#egg=foobar
+            # requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1',
+            line))
+            # http://foo.bar/baz/foobar/zipball/master#egg=foobar
         elif re.match(r'\s*https?:', line):
             requirements.append(re.sub(r'\s*https?:.*#egg=(.*)$', r'\1',
                                 line))
index c8e0743..37ede8e 100644 (file)
@@ -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()))
index 8e8d3d9..1e7ded7 100644 (file)
@@ -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
 
index a586fd1..f44550f 100644 (file)
@@ -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()