diff --git a/docs/tickets/15.md b/docs/tickets/15.md index 9a11629..b919e6e 100644 --- a/docs/tickets/15.md +++ b/docs/tickets/15.md @@ -119,7 +119,7 @@ With JS: dropdown/popover with format picker, async download. - [x] Implement wiki edit permissions in Namespace (`can_wiki_edit()`) - [x] Store revisions on edit (`node.wiki_edit()`) - [x] Revision history API endpoint -- [ ] Diff endpoint (deferred — future work) +- [x] Diff endpoint (`GET /api/v1/revisions/{id}/diff/{other_id}`) ### Phase 4: Auto-generated themes - [x] Per-namespace theme generation (light + dark) diff --git a/remarkbox/tests/test_pandoc.py b/remarkbox/tests/test_pandoc.py index 70aa369..c15da4e 100644 --- a/remarkbox/tests/test_pandoc.py +++ b/remarkbox/tests/test_pandoc.py @@ -1,8 +1,11 @@ """Unit tests for remarkbox.lib.pandoc — pandoc subprocess wrapper.""" +import shutil import unittest import subprocess +import pytest + from remarkbox.lib.pandoc import ( convert, node_tree_to_markdown, @@ -63,6 +66,10 @@ class TestConvert(unittest.TestCase): self.assertIsInstance(result, bytes) self.assertGreater(len(result), 100) + @pytest.mark.skipif( + shutil.which("wkhtmltopdf") is None, + reason="wkhtmltopdf not installed", + ) def test_markdown_to_pdf_returns_bytes(self): result = convert("# Test\n\nContent.", "markdown", "pdf", title="Test") self.assertIsInstance(result, bytes) diff --git a/remarkbox/tests/test_undigg.py b/remarkbox/tests/test_undigg.py index 0246774..2ef0da1 100644 --- a/remarkbox/tests/test_undigg.py +++ b/remarkbox/tests/test_undigg.py @@ -4,10 +4,13 @@ Tests the export, multi-syntax, wiki mode, and theme APIs end-to-end via webtest against the full Pyramid app. """ +import shutil import transaction import unittest import webtest +import pytest + from remarkbox.models import ( Node, get_tm_session, @@ -142,6 +145,10 @@ class TestExportThread(UndiggFunctionalTests): self.assertEqual(res.status_int, 200) self.assertIn(b"Test Thread", res.body) + @pytest.mark.skipif( + shutil.which("wkhtmltopdf") is None, + reason="wkhtmltopdf not installed", + ) def test_export_thread_pdf(self): node_id = self._create_thread() res = self.testapp.get(