Skip to content

Commit 97ce170

Browse files
jrhager84claude
andcommitted
Apply black formatting to files touched by this PR
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6fa5f65 commit 97ce170

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/utils/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ async def make_request(
5353
ignore_test_run = kwargs.pop("ignore_test_run", False)
5454
request_timeout = timeout
5555
if request_timeout is None:
56-
request_timeout = getattr(getattr(settings, "general", None), "request_timeout", 15)
56+
request_timeout = getattr(
57+
getattr(settings, "general", None), "request_timeout", 15
58+
)
5759

5860
if settings.general.test_run and not ignore_test_run:
5961
if method.lower() in ("put", "post", "delete"):

tests/jobs/test_job_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ async def test_run_download_client_jobs_handles_per_job_request_errors():
4040
failing_job = MagicMock()
4141
failing_job.job.enabled = True
4242
failing_job.job_name = "remove_done_seeding"
43-
failing_job.run = AsyncMock(side_effect=requests.exceptions.ReadTimeout("timed out"))
43+
failing_job.run = AsyncMock(
44+
side_effect=requests.exceptions.ReadTimeout("timed out")
45+
)
4446

4547
with (
46-
patch.object(manager, "_download_clients_connected", AsyncMock(return_value=True)),
48+
patch.object(
49+
manager, "_download_clients_connected", AsyncMock(return_value=True)
50+
),
4751
patch.object(
4852
manager,
4953
"_get_download_client_jobs_for_client",

tests/utils/test_common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ async def test_make_request_uses_general_request_timeout_by_default():
1515
mock_response = MagicMock()
1616
mock_response.raise_for_status = MagicMock()
1717

18-
with patch("src.utils.common.asyncio.to_thread", new_callable=AsyncMock) as to_thread:
18+
with patch(
19+
"src.utils.common.asyncio.to_thread", new_callable=AsyncMock
20+
) as to_thread:
1921
to_thread.return_value = mock_response
2022

2123
await make_request("get", "http://example.com/api", settings)
@@ -34,7 +36,9 @@ async def test_make_request_allows_explicit_timeout_override():
3436
mock_response = MagicMock()
3537
mock_response.raise_for_status = MagicMock()
3638

37-
with patch("src.utils.common.asyncio.to_thread", new_callable=AsyncMock) as to_thread:
39+
with patch(
40+
"src.utils.common.asyncio.to_thread", new_callable=AsyncMock
41+
) as to_thread:
3842
to_thread.return_value = mock_response
3943

4044
await make_request("get", "http://example.com/api", settings, timeout=7)

0 commit comments

Comments
 (0)