diff options
author | Bruno Wagner <bwgpro@gmail.com> | 2015-07-22 23:55:39 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-07-23 16:16:36 -0400 |
commit | 5502318835626527d9818c360c7fd2b1a4b01145 (patch) | |
tree | 0d50168ab691001be605a9d50e034064b20f34db /src/leap/common/tests/test_http.py | |
parent | 301be892a67f88b8b9479531003403a77b36a5f2 (diff) |
[tests] implemented http feature according to test
Two test cases were broken and were implemented here:
The first was that HTTPClient should share the connection between
clients if a pool was not passed explicitly. If you initialize an
HTTPClient without a pool, it will reuse a pool created on the class.
The second was that you should be able to pass to the HTTPCLient a pool
on initialization. Added that possibility and fixed the tests accordingly
Diffstat (limited to 'src/leap/common/tests/test_http.py')
-rw-r--r-- | src/leap/common/tests/test_http.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/common/tests/test_http.py b/src/leap/common/tests/test_http.py index e240ca3..a586fd1 100644 --- a/src/leap/common/tests/test_http.py +++ b/src/leap/common/tests/test_http.py @@ -47,7 +47,12 @@ class HTTPClientTest(BaseLeapTest): 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.createPool(maxPersistentPerHost=42, persistent=False) + custom_pool = http._HTTPConnectionPool( + None, + timeout=10, + maxPersistentPerHost=42, + persistent=False + ) self.assertEquals(custom_pool.maxPersistentPerHost, 42, "Custom persistent connections limit is not being respected") self.assertFalse(custom_pool.persistent, |