1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/util/test/test_html.py
2019-12-02 12:23:08 -05:00

18 lines
450 B
Python

import pytest
from util.html import html2text
@pytest.mark.parametrize(
"input, expected",
[
("hello world", "hello world"),
("hello <strong>world</strong>", "hello *world*"),
("<ul><li>foo</li><li>bar</li><li>baz</li></ul>", "* foo\n* bar\n* baz"),
("<hr>", ("-" * 80)),
('<a href="foo">bar</a>', "[bar](foo)"),
],
)
def test_html2text(input, expected):
assert html2text(input) == expected