aboutsummaryrefslogtreecommitdiff
path: root/test/test_connectionpool.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:39 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:39 -0700
commit0f393d00b51bc54c5075447e4a8b21f0bed6acd8 (patch)
tree401c9f6c345c8ec7818e2d3341086a1b889b3bc4 /test/test_connectionpool.py
parent73be7d6cc85a90ab4f67ffc27dc7eae672f7741f (diff)
downloadpython-urllib3-0f393d00b51bc54c5075447e4a8b21f0bed6acd8.tar
python-urllib3-0f393d00b51bc54c5075447e4a8b21f0bed6acd8.tar.gz
Imported Upstream version 1.9
Diffstat (limited to 'test/test_connectionpool.py')
-rw-r--r--test/test_connectionpool.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_connectionpool.py b/test/test_connectionpool.py
index 02229cf..28fb89b 100644
--- a/test/test_connectionpool.py
+++ b/test/test_connectionpool.py
@@ -5,13 +5,15 @@ from urllib3.connectionpool import (
HTTPConnection,
HTTPConnectionPool,
)
-from urllib3.util import Timeout
+from urllib3.util.timeout import Timeout
from urllib3.packages.ssl_match_hostname import CertificateError
from urllib3.exceptions import (
ClosedPoolError,
EmptyPoolError,
HostChangedError,
+ LocationValueError,
MaxRetryError,
+ ProtocolError,
SSLError,
)
@@ -127,7 +129,7 @@ class TestConnectionPool(unittest.TestCase):
HTTPConnectionPool(host='localhost'), "Test.", err)),
"HTTPConnectionPool(host='localhost', port=None): "
"Max retries exceeded with url: Test. "
- "(Caused by {0}: Test)".format(str(err.__class__)))
+ "(Caused by %r)" % err)
def test_pool_size(self):
@@ -186,7 +188,6 @@ class TestConnectionPool(unittest.TestCase):
self.assertRaises(Empty, old_pool_queue.get, block=False)
-
def test_pool_timeouts(self):
pool = HTTPConnectionPool(host='localhost')
conn = pool._new_conn()
@@ -201,6 +202,10 @@ class TestConnectionPool(unittest.TestCase):
self.assertEqual(pool.timeout._connect, 3)
self.assertEqual(pool.timeout.total, None)
+ def test_no_host(self):
+ self.assertRaises(LocationValueError, HTTPConnectionPool, None)
+
+
if __name__ == '__main__':
unittest.main()