diff --git a/tests/test_md2doc_renderers.py b/tests/test_md2doc_renderers.py index 1944831..6f1e78f 100644 --- a/tests/test_md2doc_renderers.py +++ b/tests/test_md2doc_renderers.py @@ -27,8 +27,9 @@ def test_render_h1_uses_heading1_style_and_text(): node = BeautifulSoup("

My Title

", "html.parser").find("h1") _render_heading(doc, node, level=1, style=style) root = get_doc_xml(doc) - pStyles = [p.text for p in root.iter(f"{{{W_NS}}}pStyle")] - assert "Heading1" in pStyles + # pStyle is an attribute, not text content + pStyle_vals = [p.get(f"{{{W_NS}}}val") for p in root.iter(f"{{{W_NS}}}pStyle")] + assert "Heading1" in pStyle_vals texts = [t.text for t in root.iter(f"{{{W_NS}}}t")] assert "My Title" in texts @@ -44,13 +45,13 @@ def test_render_h1_has_bottom_border(): def test_render_h1_applies_style_heading_color(): - """Heading color should come from STYLES[style]['heading_color'].""" + """Heading color should come from STYLES[style]['heading_color'] (case-insensitive).""" doc = Document() style = STYLES["report"] node = BeautifulSoup("

Title

", "html.parser").find("h1") _render_heading(doc, node, level=1, style=style) root = get_doc_xml(doc) - colors = [c.get(f"{{{W_NS}}}val") for c in root.iter(f"{{{W_NS}}}color")] + colors = [c.get(f"{{{W_NS}}}val").lower() for c in root.iter(f"{{{W_NS}}}color")] assert "1e3a8a" in colors, f"expected heading color 1e3a8a from 'report' style, got {colors}"