From bfda92e95cfbad383867a8bca451ea36e27653c1 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sun, 20 Apr 2025 17:51:37 -0700 Subject: [PATCH] Remove bad test --- tests/cli/test_run.py | 55 ------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/tests/cli/test_run.py b/tests/cli/test_run.py index 58bd3c097..827d90a9d 100644 --- a/tests/cli/test_run.py +++ b/tests/cli/test_run.py @@ -1,11 +1,4 @@ -from pathlib import Path -from unittest.mock import Mock, patch - import pytest -from typer.testing import CliRunner - -from fastmcp import FastMCP -from fastmcp.cli.cli import app @pytest.fixture @@ -27,51 +20,3 @@ if __name__ == "__main__": """ ) return server_path - - -def test_cli_run_transport_kwargs(): - """Test that transport_kwargs are correctly passed from CLI to server.run()""" - runner = CliRunner() - - # Need to mock both the file parsing and the server import - with ( - patch("fastmcp.cli.cli._parse_file_path") as mock_parse_file_path, - patch("fastmcp.cli.cli._import_server") as mock_import_server, - ): - # Make _parse_file_path return a fake path and server object - mock_parse_file_path.return_value = (Path("fake_server.py"), "mcp") - - # Create a mock server with a mock run method - mock_server = FastMCP(name="MockServer") - mock_server.run = Mock() - - # Make _import_server return our mock server - mock_import_server.return_value = mock_server - - # Run the CLI command with transport_kwargs - result = runner.invoke( - app, - [ - "run", - "fake_server.py", - "--transport", - "sse", - "--host", - "127.0.0.1", - "--port", - "9000", - "--log-level", - "DEBUG", - ], - ) - - # Check that the run method was called with the correct kwargs - mock_server.run.assert_called_once_with( - transport="sse", - host="127.0.0.1", - port=9000, - log_level="DEBUG", - ) - - # Check CLI command succeeded - assert result.exit_code == 0