mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-26 15:34:18 +02:00
Support factory functions in fastmcp run (#1384)
This commit is contained in:
parent
78e9bab244
commit
d52d6d8fff
10 changed files with 249 additions and 143 deletions
|
|
@ -306,7 +306,7 @@ class TestCursorCommand:
|
|||
|
||||
@patch("fastmcp.cli.install.cursor.install_cursor")
|
||||
@patch("fastmcp.cli.install.cursor.process_common_args")
|
||||
def test_cursor_command_basic(self, mock_process_args, mock_install):
|
||||
async def test_cursor_command_basic(self, mock_process_args, mock_install):
|
||||
"""Test basic cursor command execution."""
|
||||
mock_process_args.return_value = (
|
||||
Path("server.py"),
|
||||
|
|
@ -318,7 +318,7 @@ class TestCursorCommand:
|
|||
mock_install.return_value = True
|
||||
|
||||
with patch("sys.exit") as mock_exit:
|
||||
cursor_command("server.py")
|
||||
await cursor_command("server.py")
|
||||
|
||||
mock_install.assert_called_once_with(
|
||||
file=Path("server.py"),
|
||||
|
|
@ -335,7 +335,7 @@ class TestCursorCommand:
|
|||
|
||||
@patch("fastmcp.cli.install.cursor.install_cursor")
|
||||
@patch("fastmcp.cli.install.cursor.process_common_args")
|
||||
def test_cursor_command_failure(self, mock_process_args, mock_install):
|
||||
async def test_cursor_command_failure(self, mock_process_args, mock_install):
|
||||
"""Test cursor command when installation fails."""
|
||||
mock_process_args.return_value = (
|
||||
Path("server.py"),
|
||||
|
|
@ -347,6 +347,6 @@ class TestCursorCommand:
|
|||
mock_install.return_value = False
|
||||
|
||||
with pytest.raises(SystemExit) as exc_info:
|
||||
cursor_command("server.py")
|
||||
await cursor_command("server.py")
|
||||
|
||||
assert exc_info.value.code == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue