mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-30 17:14:53 +01:00
929e3aa78e
* added format to markdown * comments * added markdown tests
21 lines
684 B
Python
21 lines
684 B
Python
import pytest
|
|
|
|
from mobilizon_bots.formatting.description import html_to_plaintext
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"description, expected_output",
|
|
[
|
|
["", ""],
|
|
["<p>Description</p>", "Description"],
|
|
[
|
|
"<p>Some description <em>abc</em></p><p></p><p><strong>Bold</strong></p><p></p>"
|
|
"<p><em>Italic</em></p><p></p><blockquote><p>Quote</p></blockquote>",
|
|
"Some description abc\n\nBold\n\nItalic\n\nQuote",
|
|
],
|
|
["<p><a href='https://some_link.com'>Some Link</a></p>", "Some Link"],
|
|
],
|
|
)
|
|
def test_html_to_plaintext(description, expected_output):
|
|
assert html_to_plaintext(description) == expected_output
|