diff --git a/doorstop/core/tests/files/published.html b/doorstop/core/tests/files/published.html index 3fdbe718f..081b52931 100644 --- a/doorstop/core/tests/files/published.html +++ b/doorstop/core/tests/files/published.html @@ -105,7 +105,22 @@
Hello, world!
Hello, world!
- +plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
+@startuml
+Author --> (Create Document)
+Author --> (Create Item)
+Author --> (Link Item to Document)
+Author --> (Link Item to other Item)
+Author --> (Edit Item)
+Author --> (Review Item)
+Author -> (Delete Item)
+Author -> (Delete Document)
+(Export) <- (Author)
+(Import) <- (Author)
+Reviewer --> (Review Item)
+System --> (Suspect Changes)
+System --> (Integrity)
+@enduml
Hello, world!
diff --git a/doorstop/core/tests/files/published2.html b/doorstop/core/tests/files/published2.html index ecc2a319f..f1c1435d5 100644 --- a/doorstop/core/tests/files/published2.html +++ b/doorstop/core/tests/files/published2.html @@ -105,7 +105,22 @@Hello, world!
Hello, world!
- +plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
+@startuml
+Author --> (Create Document)
+Author --> (Create Item)
+Author --> (Link Item to Document)
+Author --> (Link Item to other Item)
+Author --> (Edit Item)
+Author --> (Review Item)
+Author -> (Delete Item)
+Author -> (Delete Document)
+(Export) <- (Author)
+(Import) <- (Author)
+Reviewer --> (Review Item)
+System --> (Suspect Changes)
+System --> (Integrity)
+@enduml
Hello, world!
Test Math Expressions in Latex Style:
diff --git a/doorstop/core/tests/test_all.py b/doorstop/core/tests/test_all.py index 155c325aa..9a6ddbbea 100644 --- a/doorstop/core/tests/test_all.py +++ b/doorstop/core/tests/test_all.py @@ -11,9 +11,12 @@ import shutil import tempfile import unittest +from typing import List from unittest.mock import Mock, patch +import markdown import openpyxl +import plantuml_markdown import yaml from doorstop import common, core @@ -649,8 +652,17 @@ def test_lines_markdown_document_without_child_links(self): self.assertEqual(expected, text) common.write_text(text, path) - def test_lines_html_document_linkify(self): + @patch("plantuml_markdown.PlantUMLPreprocessor.run") + @patch("plantuml_markdown.PlantUMLPreprocessor.__init__") + def test_lines_html_document_linkify(self, ext_init, ext_run): """Verify HTML can be published from a document.""" + + def run(lines: List[str]) -> List[str]: + return lines + + ext_init.return_value = None + ext_run.side_effect = run + path = os.path.join(FILES, "published.html") expected = common.read_text(path) # Act @@ -664,9 +676,18 @@ def test_lines_html_document_linkify(self): common.write_text(actual, path) self.assertEqual(expected, actual) + @patch("plantuml_markdown.PlantUMLPreprocessor.run") + @patch("plantuml_markdown.PlantUMLPreprocessor.__init__") @patch("doorstop.settings.PUBLISH_CHILD_LINKS", False) - def test_lines_html_document_without_child_links(self): + def test_lines_html_document_without_child_links(self, ext_init, ext_run): """Verify HTML can be published from a document w/o child links.""" + + def run(lines: List[str]) -> List[str]: + return lines + + ext_init.return_value = None + ext_run.side_effect = run + path = os.path.join(FILES, "published2.html") expected = common.read_text(path) # Act