MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / test_get_uv_path

Function test_get_uv_path

tests/cli/test_claude.py:162–169  ·  view source on GitHub ↗

Should return shutil.which's result, or fall back to bare 'uv' when not on PATH.

(monkeypatch: pytest.MonkeyPatch, which_result: str | None, expected: str)

Source from the content-addressed store, hash-verified

160
161@pytest.mark.parametrize("which_result, expected", [("/usr/local/bin/uv", "/usr/local/bin/uv"), (None, "uv")])
162def test_get_uv_path(monkeypatch: pytest.MonkeyPatch, which_result: str | None, expected: str):
163 """Should return shutil.which's result, or fall back to bare 'uv' when not on PATH."""
164
165 def fake_which(cmd: str) -> str | None:
166 return which_result
167
168 monkeypatch.setattr("shutil.which", fake_which)
169 assert get_uv_path() == expected
170
171
172@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

get_uv_pathFunction · 0.90

Tested by

no test coverage detected