diff --git a/test/mitmproxy/contentviews/test_xml_html.py b/test/mitmproxy/contentviews/test_xml_html.py index 2b0aee4d6..8148fd4ce 100644 --- a/test/mitmproxy/contentviews/test_xml_html.py +++ b/test/mitmproxy/contentviews/test_xml_html.py @@ -11,6 +11,13 @@ def test_simple(): v = full_eval(xml_html.ViewXmlHtml()) assert v(b"foo") == ('XML', [[('text', 'foo')]]) assert v(b"") == ('HTML', [[('text', '')]]) + assert v(b"<>") == ('XML', [[('text', '<>')]]) + assert v(b"
)" @pytest.mark.parametrize("filename", [ @@ -18,6 +25,7 @@ def test_simple(): "cdata.xml", "comment.xml", "inline.html", + "test.html" ]) def test_format_xml(filename): path = data.path(filename) diff --git a/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html b/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html new file mode 100644 index 000000000..0eb600048 --- /dev/null +++ b/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html @@ -0,0 +1,44 @@ + + +
+ ++ Lorem ipsum dolor +
+ sit amet, consectetur +
+ adipiscing elit, sed +
+ do eiusmod tempor +
+ incididunt ut +
+ labore et dolore +
+ magna aliqua. +
+ Ut enim ad minim +
+ veniam, quis nostrud +
+ exercitation +
+ ullamco laboris +
+ nisi ut aliquip ex ea +
+ commodo consequat. +
+ Duis aute irure +
+ dolor in reprehenderit +
+ in voluptate velit +
+ esse cillum dolore +
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ + diff --git a/test/mitmproxy/contentviews/test_xml_html_data/test.html b/test/mitmproxy/contentviews/test_xml_html_data/test.html new file mode 100644 index 000000000..e74ac3146 --- /dev/null +++ b/test/mitmproxy/contentviews/test_xml_html_data/test.html @@ -0,0 +1,14 @@ + + + + +Lorem ipsum dolor
sit amet, consectetur
adipiscing elit, sed
do eiusmod tempor
incididunt ut
labore et dolore
magna aliqua. +
Ut enim ad minim
veniam, quis nostrud
exercitation
ullamco laboris
+ nisi ut aliquip ex ea
commodo consequat.
Duis aute irure
dolor in reprehenderit
in voluptate velit
esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ + + + \ No newline at end of file