Test tool with enum parameter.
()
| 212 | |
| 213 | |
| 214 | def test_tool_with_enum(): |
| 215 | """Test tool with enum parameter.""" |
| 216 | tool = MockEnumTool() |
| 217 | schema = tool.to_schema() |
| 218 | |
| 219 | status_prop = schema["input_schema"]["properties"]["status"] |
| 220 | assert "enum" in status_prop |
| 221 | assert status_prop["enum"] == ["active", "inactive", "pending"] |
| 222 | |
| 223 | # Test OpenAI schema too |
| 224 | openai_schema = tool.to_openai_schema() |
| 225 | status_prop_openai = openai_schema["function"]["parameters"]["properties"]["status"] |
| 226 | assert "enum" in status_prop_openai |
| 227 | assert status_prop_openai["enum"] == ["active", "inactive", "pending"] |
| 228 | |
| 229 | |
| 230 | def test_tool_schema_consistency(): |
nothing calls this directly
no test coverage detected