feat: monaco editor toegevoegd voor py bestanden

This commit is contained in:
kodi
2026-03-12 17:28:23 +01:00
parent d12319392f
commit 939a7fd191
8 changed files with 16 additions and 1 deletions
@@ -18,6 +18,7 @@ TEXT_CONTENT_TYPES = {
".yaml": "text/yaml",
".json": "application/json",
".js": "text/javascript",
".py": "text/x-python",
".css": "text/css",
".html": "text/html",
}
Binary file not shown.
@@ -67,6 +67,19 @@ class EditApiGoldenTest(unittest.TestCase):
self.assertFalse(body["truncated"])
self.assertIn("modified", body)
def test_edit_view_python_success(self) -> None:
file_path = self.root / "script.py"
file_path.write_text("print('hello')\n", encoding="utf-8")
response = self._request("GET", "/api/files/view", params={"path": "storage1/script.py", "for_edit": "true"})
self.assertEqual(response.status_code, 200)
body = response.json()
self.assertEqual(body["path"], "storage1/script.py")
self.assertEqual(body["name"], "script.py")
self.assertEqual(body["content_type"], "text/x-python")
self.assertEqual(body["content"], "print('hello')\n")
def test_save_success(self) -> None:
file_path = self.root / "notes.txt"
file_path.write_text("hello", encoding="utf-8")
@@ -156,6 +156,7 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertIn('function openRenamePopup()', app_js)
self.assertIn('document.getElementById("rename-btn").onclick = openRenamePopup;', app_js)
self.assertIn('return triggerActionButton("rename-btn");', app_js)
self.assertIn('".py"', app_js)
self.assertIn('function openVideoViewer()', app_js)
self.assertIn('function openPdfViewer()', app_js)
self.assertIn('async function loadMonacoModule()', app_js)