changes 3
All checks were successful
Build Org Website / build (push) Successful in 54s

This commit is contained in:
2026-05-07 16:32:09 +01:00
parent 3cb44b880c
commit 6322e54ba1
3 changed files with 60 additions and 15 deletions

View File

@@ -172,6 +172,23 @@ class PageRenderingTests(AuthoringServerTestCase):
self.assertEqual(set(paths), {"blogs/keep.org", "home/notes.org", "lima/index.md"})
def test_list_pages_skips_files_that_fail_to_read(self):
good = self.blogs / "keep.org"
bad = self.blogs / "bad.org"
good.write_text("#+TITLE: Keep\n#+DATE: <2026-05-07 Thu 12:00>\n", encoding="utf-8")
bad.write_text("#+TITLE: Bad\n", encoding="utf-8")
original_read_page = server.read_page
def read_page(path):
if path == bad:
raise OSError("file disappeared")
return original_read_page(path)
with mock.patch.object(server, "read_page", side_effect=read_page):
paths = [page["path"] for page in server.list_pages()]
self.assertEqual(paths, ["blogs/keep.org"])
def test_relative_asset_path_is_calculated_from_lima_page_directory(self):
self.assertEqual(
server.relative_asset_path("lima/family/update.md", "assets/images/hzone/pic.png"),