Test that both schema methods produce consistent data.
()
| 228 | |
| 229 | |
| 230 | def test_tool_schema_consistency(): |
| 231 | """Test that both schema methods produce consistent data.""" |
| 232 | tool = MockCalculatorTool() |
| 233 | |
| 234 | anthropic_schema = tool.to_schema() |
| 235 | openai_schema = tool.to_openai_schema() |
| 236 | |
| 237 | # Names should match |
| 238 | assert anthropic_schema["name"] == openai_schema["function"]["name"] |
| 239 | # Descriptions should match |
| 240 | assert anthropic_schema["description"] == openai_schema["function"]["description"] |
| 241 | # Parameters should match (just different nesting) |
| 242 | assert anthropic_schema["input_schema"] == openai_schema["function"]["parameters"] |
| 243 | |
| 244 | |
| 245 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected