mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-09 10:39:11 +02:00
fix: preserve pythonpath for built-in mcp servers (#5117)
This commit is contained in:
parent
b3432873fb
commit
524fa9dce2
3 changed files with 40 additions and 3 deletions
22
tests/test_builtin_mcp_pythonpath.py
Normal file
22
tests/test_builtin_mcp_pythonpath.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import os
|
||||
|
||||
from src.builtin_mcp import builtin_python_env
|
||||
|
||||
|
||||
def test_builtin_python_env_preserves_existing_pythonpath(monkeypatch):
|
||||
monkeypatch.setenv(
|
||||
"PYTHONPATH",
|
||||
os.pathsep.join(["/app/venv/lib/python3.13/site-packages", "/app", "/extra"]),
|
||||
)
|
||||
|
||||
env = builtin_python_env("/app")
|
||||
|
||||
assert env == {
|
||||
"PYTHONPATH": os.pathsep.join(["/app", "/app/venv/lib/python3.13/site-packages", "/extra"])
|
||||
}
|
||||
|
||||
|
||||
def test_builtin_python_env_uses_app_root_without_existing_pythonpath(monkeypatch):
|
||||
monkeypatch.delenv("PYTHONPATH", raising=False)
|
||||
|
||||
assert builtin_python_env("/srv/odysseus") == {"PYTHONPATH": "/srv/odysseus"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue