mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-12 12:37:32 +00:00
fix: preserve pythonpath for built-in mcp servers (#5117)
This commit is contained in:
@@ -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"}
|
||||
Reference in New Issue
Block a user