urllib3: add a test to verify that providing http_auth as a list works

This commit is contained in:
Njal Karevoll
2013-10-02 01:01:30 +02:00
committed by Honza Kral
parent 1a9fd9e105
commit 6a0f5c7646
+4
View File
@@ -34,6 +34,10 @@ class TestUrllib3Connection(TestCase):
con = Urllib3HttpConnection(http_auth=('username', 'secret'))
self.assertEquals({'authorization': 'Basic dXNlcm5hbWU6c2VjcmV0'}, con.pool.headers)
def test_http_auth_list(self):
con = Urllib3HttpConnection(http_auth=['username', 'secret'])
self.assertEquals({'authorization': 'Basic dXNlcm5hbWU6c2VjcmV0'}, con.pool.headers)
def test_uses_https_if_specified(self):
con = Urllib3HttpConnection(use_ssl=True)
self.assertIsInstance(con.pool, urllib3.HTTPSConnectionPool)