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

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