mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Raise an error if a Client is created with no servers in config
This commit is contained in:
parent
5f6393cd3f
commit
06b9b98b6c
2 changed files with 17 additions and 1 deletions
|
|
@ -673,6 +673,18 @@ class TestInferTransport:
|
|||
assert transport.transport.command == "echo"
|
||||
assert transport.transport.args == ["hello"]
|
||||
|
||||
def test_config_with_no_servers(self):
|
||||
"""Test that an empty MCPConfig raises a ValueError."""
|
||||
config = {"mcpServers": {}}
|
||||
with pytest.raises(ValueError, match="No MCP servers defined in the config"):
|
||||
infer_transport(config)
|
||||
|
||||
def test_mcpconfigtransport_with_no_servers(self):
|
||||
"""Test that MCPConfigTransport raises a ValueError when initialized with an empty config."""
|
||||
config = {"mcpServers": {}}
|
||||
with pytest.raises(ValueError, match="No MCP servers defined in the config"):
|
||||
MCPConfigTransport(config=config)
|
||||
|
||||
def test_infer_composite_client(config):
|
||||
config = {
|
||||
"mcpServers": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue