mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-15 18:16:56 +01:00
2c8063cf4a
* fixed visualization * simplified tests * split into files * refactored test expected publications * split update tests * expanded specifications and tests * added event_status window tests * fixed 'all' command * renamed everything * fixed uppercase
24 lines
773 B
Python
24 lines
773 B
Python
import pytest
|
|
|
|
from mobilizon_reshare.formatting.description import html_to_markdown
|
|
|
|
|
|
@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\n**Bold**\n\n*Italic*\n\n\n\\> Quote\n\\> \n\\>""",
|
|
],
|
|
[
|
|
"<p><a href='https://some_link.com'>Some Link</a></p>",
|
|
"[Some Link](https://some_link.com)",
|
|
],
|
|
],
|
|
)
|
|
def test_html_to_markdown(description, expected_output):
|
|
assert html_to_markdown(description) == expected_output
|