diff options
Diffstat (limited to 'test/mitmproxy/contentviews/test_html.py')
-rw-r--r-- | test/mitmproxy/contentviews/test_html.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/mitmproxy/contentviews/test_html.py b/test/mitmproxy/contentviews/test_html.py new file mode 100644 index 00000000..8d5818e5 --- /dev/null +++ b/test/mitmproxy/contentviews/test_html.py @@ -0,0 +1,18 @@ +from mitmproxy.contentviews import html +from . import full_eval + + +def test_view_html(): + v = full_eval(html.ViewHTML()) + s = b"<html><br><br></br><p>one</p></html>" + assert v(s) + + s = b"gobbledygook" + assert not v(s) + + +def test_view_html_outline(): + v = full_eval(html.ViewHTMLOutline()) + s = b"<html><br><br></br><p>one</p></html>" + assert v(s) + assert v(b'\xfe') |