Files
markdown-exec/tests/test_python.py
T
2022-02-11 23:52:41 +01:00

36 lines
721 B
Python

"""Tests for the `python` module."""
from markdown.core import Markdown
def test_output_markdown(md: Markdown) -> None:
"""Assert Markdown is converted to HTML.
Parameters:
md: A Markdown instance (fixture).
"""
html = md.convert(
"""
```python exec="yes"
output_markdown("**Bold!**")
```
"""
)
assert "<strong>Bold!</strong>" in html
def test_output_html(md: Markdown) -> None:
"""Assert HTML is injected as is.
Parameters:
md: A Markdown instance (fixture).
"""
html = md.convert(
"""
```python exec="yes"
output_html("**Bold!**")
```
"""
)
assert "**Bold!**" in html