Skip to content

Commit a931136

Browse files
committed
Formatting
1 parent 52f1081 commit a931136

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

src/commercetools/base_client.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
from requests_oauthlib import OAuth2Session
99
from urllib3 import Retry
1010

11-
from commercetools.version import __version__
1211
from commercetools.constants import HEADER_CORRELATION_ID
1312
from commercetools.exceptions import CommercetoolsError
1413
from commercetools.helpers import _concurrent_retry
1514
from commercetools.services import ServicesMixin
1615
from commercetools.utils import BaseTokenSaver, DefaultTokenSaver, fix_token_url
16+
from commercetools.version import __version__
1717

1818

1919
class RefreshingOAuth2Session(OAuth2Session):
@@ -88,7 +88,7 @@ def __init__(
8888
},
8989
token_updater=self._save_token,
9090
)
91-
self._http_client.headers.update({'User-Agent': self._get_user_agent()})
91+
self._http_client.headers.update({"User-Agent": self._get_user_agent()})
9292

9393
if not http_adapter:
9494
# Register retry handling for Connection errors and 502, 503, 504.
@@ -223,10 +223,15 @@ def _read_env_vars(self, config: dict) -> dict:
223223
return config
224224

225225
def _get_user_agent(self):
226-
py_version = "%d.%d" % sys.version_info[0:2]
226+
py_version = "%d.%d" % sys.version_info[0:2]
227227
arch = platform.machine()
228228
return "commercetools-python-sdk/%s Python/%s (%s; %s; %s)" % (
229-
__version__, py_version, sys.implementation.name, sys.platform, arch)
229+
__version__,
230+
py_version,
231+
sys.implementation.name,
232+
sys.platform,
233+
arch,
234+
)
230235

231236

232237
class Client(BaseClient, ServicesMixin):

src/commercetools/testing/auth.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ def is_valid(self, client_id, client_secret):
2020

2121
class AuthBackend(BaseBackend):
2222
path_prefix = r"/oauth/(?P<path>.*)"
23-
hostnames = ["auth.europe-west1.gcp.commercetools.com", "auth.sphere.io", "localhost"]
23+
hostnames = [
24+
"auth.europe-west1.gcp.commercetools.com",
25+
"auth.sphere.io",
26+
"localhost",
27+
]
2428
model_class = AuthModel
2529

2630
def __init__(self, *args, **kwargs):

src/commercetools/testing/internal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
class InternalBackend(BaseBackend):
66
path_prefix = r"/-/(?P<path>.*)"
7-
hostnames = ["auth.europe-west1.gcp.commercetools.com", "auth.sphere.io", "localhost"]
7+
hostnames = [
8+
"auth.europe-west1.gcp.commercetools.com",
9+
"auth.sphere.io",
10+
"localhost",
11+
]
812

913
def urls(self):
1014
return [("^health$", "GET", self.health)]

0 commit comments

Comments
 (0)