Test Tool.to_schema() method.
()
| 135 | |
| 136 | |
| 137 | def test_tool_to_schema(): |
| 138 | """Test Tool.to_schema() method.""" |
| 139 | tool = MockWeatherTool() |
| 140 | schema = tool.to_schema() |
| 141 | |
| 142 | assert isinstance(schema, dict) |
| 143 | assert schema["name"] == "get_weather" |
| 144 | assert schema["description"] == "Get weather information" |
| 145 | assert "input_schema" in schema |
| 146 | assert schema["input_schema"]["type"] == "object" |
| 147 | assert "location" in schema["input_schema"]["properties"] |
| 148 | assert schema["input_schema"]["required"] == ["location"] |
| 149 | |
| 150 | |
| 151 | def test_tool_to_openai_schema(): |
nothing calls this directly
no test coverage detected