()
| 68 | |
| 69 | |
| 70 | def 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 | |
| 94 | def test_create_servers_table(): |
nothing calls this directly
no test coverage detected