Skip to content

Commit

Permalink
B2HTTP_CLASS is now dependency-injected into B2Session
Browse files Browse the repository at this point in the history
  • Loading branch information
mpnowacki-reef committed Jul 30, 2021
1 parent 2545427 commit ce5e86e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion b2sdk/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class B2Session(object):
to methods of underlying raw_api and reauthorizes if necessary.
"""
SQLITE_ACCOUNT_INFO_CLASS = staticmethod(SqliteAccountInfo)
B2HTTP_CLASS = staticmethod(B2Http)

def __init__(
self,
Expand All @@ -67,7 +68,7 @@ def __init__(
:param api_config
"""

self.raw_api = api_config.raw_api_class(B2Http(api_config))
self.raw_api = api_config.raw_api_class(self.B2HTTP_CLASS(api_config))
if account_info is None:
account_info = self.SQLITE_ACCOUNT_INFO_CLASS()
if cache is None:
Expand Down

0 comments on commit ce5e86e

Please sign in to comment.