Skip to content

Commit b1d6b22

Browse files
committed
Bugzilla: add get_requests_session() API
Return the backing requests.Session object to the user, incase they need to specify any special config to communicate with bugzilla Signed-off-by: Cole Robinson <[email protected]>
1 parent 465f1cd commit b1d6b22

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

bugzilla/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,15 @@ def is_rest(self):
539539
"""
540540
return self._backend.is_rest()
541541

542+
def get_requests_session(self):
543+
"""
544+
Give API users access to the Requests.session object we use for
545+
talking to the remote bugzilla instance.
546+
547+
:returns: The Requests.session object backing the open connection.
548+
"""
549+
return self._session.get_requests_session()
550+
542551
def disconnect(self):
543552
"""
544553
Disconnect from the given bugzilla instance.

tests/test_api_misc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def test_get_xmlrpc_proxy():
298298

299299
assert bz.is_xmlrpc() is False
300300
assert bz.is_rest() is False
301+
assert hasattr(bz.get_requests_session(), "request")
301302

302303

303304
def test_query_url_fail():

0 commit comments

Comments
 (0)