Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions tests/general/test_html_parsing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Regression tests for HTML parsing."""

import pytest

from inbox.util.html import HTMLParseError, strip_tags
from inbox.util.html import strip_tags


def test_strip_tags() -> None:
Expand All @@ -14,14 +12,11 @@ def test_strip_tags() -> None:

# MS Word conditional marked section
text = "<![if word]>content<![endif]>"

assert strip_tags(text).strip() == "content"

# Unknown marked section
text = """<![FOR]>"""

with pytest.raises(HTMLParseError):
strip_tags(text)
# An unknown marked section is simply dropped.
text = "before<![FOR]>after"
assert strip_tags(text).strip() == "beforeafter"


def test_preserve_refs() -> None:
Expand Down