This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/util/test/test_html.py

14 lines
402 B
Python
Raw Normal View History

2019-11-12 16:09:47 +00:00
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