fix: tests for pictures
This commit is contained in:
@@ -199,11 +199,9 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
|
||||
"""
|
||||
|
||||
def render_picture(self, token):
|
||||
alt_text = "Alt-Text noch nicht verfügbar"
|
||||
if self.picture_handler is not None:
|
||||
alt_text = self.picture_handler(token.id)
|
||||
|
||||
if alt_text is None:
|
||||
alt_text = "Alt-Text noch nicht verfügbar"
|
||||
alt_text = self.picture_handler(token.id) or alt_text
|
||||
|
||||
return self.render_picture_helper(token.id, token.ref, token.text, token.number, alt_text)
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ from test.util import paragraph
|
||||
@pytest.mark.html
|
||||
def test_picture_html():
|
||||
assertions = {
|
||||
"[picture:123:abc:Text]": FiftyOhmHtmlRenderer.render_picture_helper("123", "abc", "Text", "TODO"),
|
||||
"[picture:0:abc:Text]": FiftyOhmHtmlRenderer.render_picture_helper(
|
||||
"0", "abc", "Text", "TODO", "Alt-Text noch nicht verfügbar"
|
||||
),
|
||||
}
|
||||
|
||||
for assertion in assertions:
|
||||
@@ -19,7 +21,7 @@ def test_picture_html():
|
||||
@pytest.mark.latex
|
||||
def test_picture_latex():
|
||||
assertions = {
|
||||
"[picture:123:abc:Text]": FiftyOhmLaTeXRenderer.render_picture_helper("123", "abc", "Text", "TODO"),
|
||||
"[picture:0:abc:Text]": FiftyOhmLaTeXRenderer.render_picture_helper("0", "abc", "Text", "TODO"),
|
||||
}
|
||||
|
||||
for assertion in assertions:
|
||||
|
||||
Reference in New Issue
Block a user