Skip to content

Commit bfda92e

Browse files
committed
Remove bad test
1 parent ee69642 commit bfda92e

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

Diff for: tests/cli/test_run.py

-55
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
from pathlib import Path
2-
from unittest.mock import Mock, patch
3-
41
import pytest
5-
from typer.testing import CliRunner
6-
7-
from fastmcp import FastMCP
8-
from fastmcp.cli.cli import app
92

103

114
@pytest.fixture
@@ -27,51 +20,3 @@ def hello(name: str) -> str:
2720
"""
2821
)
2922
return server_path
30-
31-
32-
def test_cli_run_transport_kwargs():
33-
"""Test that transport_kwargs are correctly passed from CLI to server.run()"""
34-
runner = CliRunner()
35-
36-
# Need to mock both the file parsing and the server import
37-
with (
38-
patch("fastmcp.cli.cli._parse_file_path") as mock_parse_file_path,
39-
patch("fastmcp.cli.cli._import_server") as mock_import_server,
40-
):
41-
# Make _parse_file_path return a fake path and server object
42-
mock_parse_file_path.return_value = (Path("fake_server.py"), "mcp")
43-
44-
# Create a mock server with a mock run method
45-
mock_server = FastMCP(name="MockServer")
46-
mock_server.run = Mock()
47-
48-
# Make _import_server return our mock server
49-
mock_import_server.return_value = mock_server
50-
51-
# Run the CLI command with transport_kwargs
52-
result = runner.invoke(
53-
app,
54-
[
55-
"run",
56-
"fake_server.py",
57-
"--transport",
58-
"sse",
59-
"--host",
60-
"127.0.0.1",
61-
"--port",
62-
"9000",
63-
"--log-level",
64-
"DEBUG",
65-
],
66-
)
67-
68-
# Check that the run method was called with the correct kwargs
69-
mock_server.run.assert_called_once_with(
70-
transport="sse",
71-
host="127.0.0.1",
72-
port=9000,
73-
log_level="DEBUG",
74-
)
75-
76-
# Check CLI command succeeded
77-
assert result.exit_code == 0

0 commit comments

Comments
 (0)