MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_tool_with_enum

Function test_tool_with_enum

tests/test_tool_schema.py:214–227  ·  view source on GitHub ↗

Test tool with enum parameter.

()

Source from the content-addressed store, hash-verified

212
213
214def 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
230def test_tool_schema_consistency():

Callers

nothing calls this directly

Calls 3

MockEnumToolClass · 0.85
to_schemaMethod · 0.80
to_openai_schemaMethod · 0.80

Tested by

no test coverage detected