Skip to content

Commit

Permalink
Modify publishing tests to use a local fixed version of plantuml
Browse files Browse the repository at this point in the history
  • Loading branch information
robtaylor committed Oct 1, 2024
1 parent d958342 commit 21f3dde
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added doorstop/core/tests/files/plantuml-1.2024.7.jar
Binary file not shown.
23 changes: 23 additions & 0 deletions doorstop/core/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
from doorstop.core.tests.helpers import on_error_with_retry
from doorstop.core.vcs import mockvcs

from doorstop.core.publishers.html import HtmlPublisher
from plantuml_markdown import PlantUMLMarkdownExtension


class TestItem(unittest.TestCase):
"""Integration tests for the Item class."""
Expand Down Expand Up @@ -575,6 +578,12 @@ def setUp(self):
self.tree = core.build(cwd=FILES, root=FILES)
self.document = self.tree.find_document("REQ")
self.temp = tempfile.mkdtemp()
# Use local plantuml of known version
plantuml_cmd = os.path.join(FILES, "plantuml-1.2024.7.jar")
plantuml_ext = next(
x for x in HtmlPublisher.EXTENSIONS if type(x) == PlantUMLMarkdownExtension
)
plantuml_ext.setConfigs({"server": "", "plantuml_cmd": plantuml_cmd})

def tearDown(self):
if os.path.exists(self.temp):
Expand Down Expand Up @@ -649,6 +658,20 @@ def test_lines_markdown_document_without_child_links(self):
self.assertEqual(expected, text)
common.write_text(text, path)

# MARKDOWN_RUN_EXTENSIONS = doorstop.core.publishers.html.HTMLPublisher.EXTENSIONS
# @patch(doorstop.core.publishers.html.HTMLPublisher,
# EXTENSIONS = (
# "markdown.extensions.extra",
# "markdown.extensions.sane_lists",
# PlantUMLMarkdownExtension(
# server="http://www.plantuml.com/plantuml",
# cachedir=tempfile.gettempdir(),
# format="svg",
# classes="class1,class2",
# title="UML",
# alt="UML Diagram",
# ),
#
def test_lines_html_document_linkify(self):
"""Verify HTML can be published from a document."""
path = os.path.join(FILES, "published.html")
Expand Down

0 comments on commit 21f3dde

Please sign in to comment.