python-html2text/tests/smoke.py
Petr Šplíchal 037c72dcb2 Enable basic test coverage in the CI
Run a simple smoke test and the upstream test suite.
Use `tmt run` to safely execute tests from your laptop.
See also: https://tmt.readthedocs.io/en/latest/guide.html
2022-03-14 10:42:18 +01:00

24 lines
349 B
Python
Executable file

#!/usr/bin/python3
import html2text
html = """
<html>
<body>
<h3>heading</h3>
<ul><li>item</li></ul>
</body>
</html>
"""
text = html2text.html2text(html)
print(text)
if "### heading" not in text:
print("Heading not converted.")
raise SystemExit(1)
if "* item" not in text:
print("List item not converted.")
raise SystemExit(1)