Skip to content

Commit 7694253

Browse files
linting
1 parent 1f87957 commit 7694253

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/nypl_py_utils/classes/oauth2_api_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def get(self, request_path, **kwargs):
4040
if retries < 3:
4141
self.logger.warning(
4242
f'Retrying get request due to empty response from\
43-
Oauth2 Client using path: {request_path}. Retry #{retries}')
43+
Oauth2 Client using path: {request_path}. \
44+
Retry #{retries}')
4445
sleep(pow(2, retries - 1))
4546
kwargs['retries'] = retries
4647
resp = self.get(request_path, **kwargs)

tests/test_oauth2_api_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ def test_http_retry_fail(self, requests_mock, test_instance_with_retries,
167167
assert get_spy.call_count == 3
168168
assert resp.status_code == 500
169169

170-
def test_http_retry_success(self, requests_mock, test_instance_with_retries,
170+
def test_http_retry_success(self, requests_mock,
171+
test_instance_with_retries,
171172
token_server_post, mocker):
172173
mocker.patch.object(test_instance_with_retries, '_do_http_method',
173174
side_effect=[MockEmptyResponse(empty=True),
174-
MockEmptyResponse(empty=False, status_code=200)])
175+
MockEmptyResponse(empty=False,
176+
status_code=200)])
175177
get_spy = mocker.spy(test_instance_with_retries, 'get')
176178
resp = test_instance_with_retries.get('spaghetti')
177179
assert get_spy.call_count == 2

0 commit comments

Comments
 (0)