mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
This commit is contained in:
parent
9ccaef2b6a
commit
fadb630142
2 changed files with 18 additions and 0 deletions
|
|
@ -91,6 +91,9 @@ def install_cursor_workspace(
|
|||
if not workspace_path.exists():
|
||||
print(f"[red]Workspace directory does not exist: {workspace_path}[/red]")
|
||||
return False
|
||||
if not workspace_path.is_dir():
|
||||
print(f"[red]Workspace path is not a directory: {workspace_path}[/red]")
|
||||
return False
|
||||
|
||||
# Create .cursor directory in workspace
|
||||
cursor_dir = workspace_path / ".cursor"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from fastmcp.cli.install.cursor import (
|
|||
cursor_command,
|
||||
generate_cursor_deeplink,
|
||||
install_cursor,
|
||||
install_cursor_workspace,
|
||||
open_deeplink,
|
||||
)
|
||||
from fastmcp.mcp_config import StdioMCPServer
|
||||
|
|
@ -356,6 +357,20 @@ class TestInstallCursor:
|
|||
# Verify failure message was printed
|
||||
mock_print.assert_called()
|
||||
|
||||
def test_install_cursor_workspace_path_is_file(self, tmp_path):
|
||||
"""Test that passing a file as workspace_path returns False."""
|
||||
file_path = tmp_path / "somefile.txt"
|
||||
file_path.write_text("hello")
|
||||
|
||||
result = install_cursor_workspace(
|
||||
file=Path("/path/to/server.py"),
|
||||
server_object=None,
|
||||
name="test-server",
|
||||
workspace_path=file_path,
|
||||
)
|
||||
|
||||
assert result is False
|
||||
|
||||
def test_install_cursor_deduplicate_packages(self):
|
||||
"""Test that duplicate packages are deduplicated."""
|
||||
with patch("fastmcp.cli.install.cursor.open_deeplink") as mock_open:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue