MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_create_tools_table_with_details

Function test_create_tools_table_with_details

tests/display/test_formatting.py:70–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69
70def test_create_tools_table_with_details():
71 ti = make_sample_tool()
72 table: Table = create_tools_table([ti], show_details=True)
73 assert table.title == "1 Available Tools"
74 # now there are four columns
75 assert [c.header for c in table.columns] == [
76 "Server",
77 "Tool",
78 "Description",
79 "Parameters",
80 ]
81 # Test that the table structure is correct
82 assert hasattr(table, "columns")
83 assert hasattr(table, "rows")
84 assert len(list(table.rows)) == 1
85 # Test that the data format function works
86 display_data = format_tool_for_display(ti, show_details=True)
87 assert display_data["server"] == "ns1"
88 assert display_data["name"] == "t1"
89 assert display_data["description"] == "Test tool"
90 assert "a (required): int" in display_data["parameters"]
91 assert "b: string" in display_data["parameters"]
92
93
94def test_create_servers_table():

Callers

nothing calls this directly

Calls 3

create_tools_tableFunction · 0.90
format_tool_for_displayFunction · 0.90
make_sample_toolFunction · 0.85

Tested by

no test coverage detected