Skip to content

Commit f06ef80

Browse files
author
Vita Stejskal
committed
KAB-923: add basic tests that check the registered tools
1 parent 2895dd2 commit f06ef80

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test_server.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import pytest
2+
3+
from keboola_mcp_server.server import create_server
4+
5+
6+
class TestServer:
7+
@pytest.mark.asyncio
8+
async def test_list_tools(self):
9+
server = create_server()
10+
tools = await server.list_tools()
11+
assert sorted(t.name for t in tools) == [
12+
"get_bucket_metadata",
13+
"get_table_metadata",
14+
"list_bucket_info",
15+
"list_bucket_tables",
16+
"list_component_configs",
17+
"list_components",
18+
"query_table",
19+
]
20+
21+
@pytest.mark.asyncio
22+
async def test_tools_have_descriptions(self):
23+
server = create_server()
24+
tools = await server.list_tools()
25+
26+
missing_descriptions: list[str] = []
27+
for t in tools:
28+
if not t.description:
29+
missing_descriptions.append(t.name)
30+
31+
missing_descriptions.sort()
32+
assert not missing_descriptions, f"These tools have no description: {missing_descriptions}"

0 commit comments

Comments
 (0)