File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,28 @@ def test_command_execution(mock_config_path: Path):
4848
4949 assert result .returncode == 0
5050 assert "usage" in result .stdout .lower ()
51+
52+
53+ def test_absolute_uv_path (mock_config_path : Path ):
54+ """Test that the absolute path to uv is used when available."""
55+ # Mock the shutil.which function to return a fake path
56+ mock_uv_path = "/usr/local/bin/uv"
57+
58+ with patch ("mcp.cli.claude.get_uv_path" , return_value = mock_uv_path ):
59+ # Setup
60+ server_name = "test_server"
61+ file_spec = "test_server.py:app"
62+
63+ # Update config
64+ success = update_claude_config (file_spec = file_spec , server_name = server_name )
65+ assert success
66+
67+ # Read the generated config
68+ config_file = mock_config_path / "claude_desktop_config.json"
69+ config = json .loads (config_file .read_text ())
70+
71+ # Verify the command is the absolute path
72+ server_config = config ["mcpServers" ][server_name ]
73+ command = server_config ["command" ]
74+
75+ assert command == mock_uv_path
You can’t perform that action at this time.
0 commit comments