refactor: use snake case instead of camel case in types (#1894)

This commit is contained in:
Marcelo Trylesinski 2026-01-16 15:51:27 +01:00 • committed by GitHub
commit e94b386a13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)