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
This commit is contained in:
parent
d94fbdd7a0
commit
037c72dcb2
5 changed files with 41 additions and 0 deletions
2
tests/smoke.fmf
Normal file
2
tests/smoke.fmf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
summary: A simple smoke test
|
||||
test: ./smoke.py
|
||||
24
tests/smoke.py
Executable file
24
tests/smoke.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/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)
|
||||
3
tests/unit.fmf
Normal file
3
tests/unit.fmf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
summary: Run the upstream test suite
|
||||
test: cd ../html2text-*/ && python3 -m pytest
|
||||
require: python3-pytest
|
||||
Loading…
Add table
Add a link
Reference in a new issue