import pytest from utils.html_text import html_to_text @pytest.mark.parametrize( ("value", "expected"), [ (None, ""), ("", ""), (" Plain summary. ", "Plain summary."), ("Line one\nLine two", "Line one\nLine two"), ("Tom "Big" Jones & co", 'Tom "Big" Jones & co'), ("

One.

\n

Two
three

", "One.\n\nTwo\nthree"), ("Bold and italic", "Bold and italic"), ('link text', "link text"), ("

after

", "• a\n• b\n\nafter"), ("

a

b

", "a\n\nb"), ( "" "
Single playerCo-op
AB
", "Single player Co-op\nA B", ), ( "", "• Save Hyrule\n\n• Again", ), ("Safe", "Safe"), ("Non breaking", "Non breaking"), ], ) def test_html_to_text(value: str | None, expected: str): assert html_to_text(value) == expected @pytest.mark.parametrize( "value", [ "Press to begin", "1 < 2 and 3 > 2", "Enter here", "Ends with