feat: file edit added

This commit is contained in:
kodi
2026-03-11 14:09:44 +01:00
parent ba6a369f78
commit b93cb01879
18 changed files with 701 additions and 16 deletions
@@ -49,18 +49,15 @@ class ViewApiGoldenTest(unittest.TestCase):
response = self._request("storage1/notes.md")
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
{
"path": "storage1/notes.md",
"name": "notes.md",
"content_type": "text/markdown",
"encoding": "utf-8",
"truncated": False,
"size": len("# title\nhello\n".encode("utf-8")),
"content": "# title\nhello\n",
},
)
body = response.json()
self.assertEqual(body["path"], "storage1/notes.md")
self.assertEqual(body["name"], "notes.md")
self.assertEqual(body["content_type"], "text/markdown")
self.assertEqual(body["encoding"], "utf-8")
self.assertFalse(body["truncated"])
self.assertEqual(body["size"], len("# title\nhello\n".encode("utf-8")))
self.assertEqual(body["content"], "# title\nhello\n")
self.assertIn("modified", body)
def test_view_unsupported_type(self) -> None:
(self.root / "report.pdf").write_bytes(b"%PDF-1.4")