Skip to content

Commit 7bb2e88

Browse files
committed
chore: Fix unit tests
1 parent 333dace commit 7bb2e88

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/toolbox-core/tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ async def test_add_headers_success(
14431443
)
14441444

14451445
async with ToolboxClient(TEST_BASE_URL) as client:
1446-
await client.add_headers(static_header)
1446+
client.add_headers(static_header)
14471447
assert client._ToolboxClient__client_headers == static_header
14481448

14491449
tool = await client.load_tool(tool_name)

packages/toolbox-core/tests/test_sync_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import inspect
1717
from typing import Any, Callable, Mapping, Optional
18-
from unittest.mock import AsyncMock, patch
18+
from unittest.mock import AsyncMock, Mock, patch
1919

2020
import pytest
2121
from aioresponses import CallbackResult, aioresponses
@@ -373,12 +373,12 @@ def test_sync_add_headers_duplicate_fail(aioresponses):
373373
mock_async_client = AsyncMock(spec=ToolboxClient)
374374

375375
# Configure add_headers to simulate the ValueError from ToolboxClient
376-
async def mock_add_headers_async(headers):
376+
def mock_add_headers(headers):
377377
# Simulate ToolboxClient's check
378378
if "X-Initial-Header" in headers:
379379
raise ValueError("Client header(s) `X-Initial-Header` already registered")
380380

381-
mock_async_client.add_headers = AsyncMock(side_effect=mock_add_headers_async)
381+
mock_async_client.add_headers = Mock(side_effect=mock_add_headers)
382382

383383
with patch(
384384
"toolbox_core.sync_client.ToolboxClient", return_value=mock_async_client

0 commit comments

Comments
 (0)