feat: troppa roba davvero

This commit is contained in:
gabdevele
2026-05-07 09:21:45 +02:00 Unverified
parent d977a953cc
commit 53dcdafdb1
73 changed files with 4772 additions and 960 deletions
+13 -6
View File
@@ -1,15 +1,20 @@
import pytest
from services.editor import python_lsp
from starlette.websockets import WebSocketDisconnect
from app.services.editor import python_lsp
def test_python_editor_session(client, monkeypatch):
session = python_lsp.PythonEditorSession(
root_path=python_lsp.WORKSPACE_ROOT,
file_path=python_lsp.WORKSPACE_ROOT / python_lsp.ENTRY_FILE,
)
monkeypatch.setattr("api.editor.router.python_lsp.lsp_binary", lambda: "/bin/lsp")
monkeypatch.setattr("api.editor.router.python_lsp.get_session", lambda: session)
monkeypatch.setattr(
"app.api.editor.router.python_lsp.lsp_binary", lambda: "/bin/lsp"
)
monkeypatch.setattr(
"app.api.editor.router.python_lsp.get_session", lambda: session
)
response = client.get("/proxy/editor/python/session")
@@ -40,11 +45,13 @@ def test_python_editor_socket_accepts_token(client, monkeypatch):
await websocket.close()
monkeypatch.setattr(
"api.editor.router.authenticate_editor_socket",
"app.api.editor.router.authenticate_editor_socket",
fake_authenticate,
)
monkeypatch.setattr("api.editor.router.python_lsp.lsp_binary", lambda: "/bin/lsp")
monkeypatch.setattr("api.editor.router.python_lsp.bridge", fake_bridge)
monkeypatch.setattr(
"app.api.editor.router.python_lsp.lsp_binary", lambda: "/bin/lsp"
)
monkeypatch.setattr("app.api.editor.router.python_lsp.bridge", fake_bridge)
with client.websocket_connect("/proxy/editor/python/ws?token=test-token") as socket:
assert socket.receive_text().endswith("/proxy_addon.py")