refactor: use snake case instead of camel case in types (#1894)
This commit is contained in:
parent
7080fcf1e6
commit
e94b386a13
1 changed files with 1063 additions and 1057 deletions
|
|
@ -103,7 +103,7 @@ def create_add_tool() -> Tool:
|
|||
return Tool(
|
||||
name="add",
|
||||
description="Add two numbers",
|
||||
inputSchema={
|
||||
input_schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"a": {"type": "number"},
|
||||
|
|
@ -133,7 +133,7 @@ async def test_valid_tool_call():
|
|||
|
||||
# Verify results
|
||||
assert result is not None
|
||||
assert not result.isError
|
||||
assert not result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
@ -155,7 +155,7 @@ async def test_invalid_tool_call_missing_required():
|
|||
|
||||
# Verify results
|
||||
assert result is not None
|
||||
assert result.isError
|
||||
assert result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
@ -178,7 +178,7 @@ async def test_invalid_tool_call_wrong_type():
|
|||
|
||||
# Verify results
|
||||
assert result is not None
|
||||
assert result.isError
|
||||
assert result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
@ -193,7 +193,7 @@ async def test_cache_refresh_on_missing_tool():
|
|||
Tool(
|
||||
name="multiply",
|
||||
description="Multiply two numbers",
|
||||
inputSchema={
|
||||
input_schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"x": {"type": "number"},
|
||||
|
|
@ -220,7 +220,7 @@ async def test_cache_refresh_on_missing_tool():
|
|||
|
||||
# Verify results - should work because cache will be refreshed
|
||||
assert result is not None
|
||||
assert not result.isError
|
||||
assert not result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
@ -234,7 +234,7 @@ async def test_enum_constraint_validation():
|
|||
Tool(
|
||||
name="greet",
|
||||
description="Greet someone",
|
||||
inputSchema={
|
||||
input_schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
|
|
@ -256,7 +256,7 @@ async def test_enum_constraint_validation():
|
|||
|
||||
# Verify results
|
||||
assert result is not None
|
||||
assert result.isError
|
||||
assert result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
@ -271,7 +271,7 @@ async def test_tool_not_in_list_logs_warning(caplog: pytest.LogCaptureFixture):
|
|||
Tool(
|
||||
name="add",
|
||||
description="Add two numbers",
|
||||
inputSchema={
|
||||
input_schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"a": {"type": "number"},
|
||||
|
|
@ -300,7 +300,7 @@ async def test_tool_not_in_list_logs_warning(caplog: pytest.LogCaptureFixture):
|
|||
|
||||
# Verify results - should succeed because validation is skipped for unknown tools
|
||||
assert result is not None
|
||||
assert not result.isError
|
||||
assert not result.is_error
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
assert isinstance(result.content[0], TextContent)
|
||||
|
|
|
|||
Loading…
Reference in a new issue