Adding tests for advanced auth options for requests
This commit is contained in:
@@ -2,6 +2,7 @@ import re
|
||||
from mock import Mock, patch
|
||||
import urllib3
|
||||
import warnings
|
||||
from requests.auth import AuthBase
|
||||
|
||||
from elasticsearch.exceptions import TransportError, ConflictError, RequestError, NotFoundError
|
||||
from elasticsearch.connection import RequestsHttpConnection, \
|
||||
@@ -87,6 +88,12 @@ class TestRequestsConnection(TestCase):
|
||||
self.assertEquals(1, len(args))
|
||||
return args[0]
|
||||
|
||||
def test_custom_http_auth_is_allowed(self):
|
||||
auth = AuthBase()
|
||||
c = RequestsHttpConnection(http_auth=auth)
|
||||
|
||||
self.assertEquals(auth, c.session.auth)
|
||||
|
||||
def test_timeout_set(self):
|
||||
con = RequestsHttpConnection(timeout=42)
|
||||
self.assertEquals(42, con.timeout)
|
||||
|
||||
Reference in New Issue
Block a user