diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/contentviews/test_html.py | 18 | ||||
-rw-r--r-- | test/mitmproxy/contentviews/test_html_outline.py | 9 | ||||
-rw-r--r-- | test/mitmproxy/contentviews/test_xml.py | 17 |
3 files changed, 9 insertions, 35 deletions
diff --git a/test/mitmproxy/contentviews/test_html.py b/test/mitmproxy/contentviews/test_html.py deleted file mode 100644 index 8d5818e5..00000000 --- a/test/mitmproxy/contentviews/test_html.py +++ /dev/null @@ -1,18 +0,0 @@ -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') diff --git a/test/mitmproxy/contentviews/test_html_outline.py b/test/mitmproxy/contentviews/test_html_outline.py new file mode 100644 index 00000000..d9ccc406 --- /dev/null +++ b/test/mitmproxy/contentviews/test_html_outline.py @@ -0,0 +1,9 @@ +from mitmproxy.contentviews import html_outline +from test.mitmproxy.contentviews import full_eval + + +def test_view_html_outline(): + v = full_eval(html_outline.ViewHTMLOutline()) + s = b"<html><br><br></br><p>one</p></html>" + assert v(s) + assert v(b'\xfe')
\ No newline at end of file diff --git a/test/mitmproxy/contentviews/test_xml.py b/test/mitmproxy/contentviews/test_xml.py deleted file mode 100644 index 680134cb..00000000 --- a/test/mitmproxy/contentviews/test_xml.py +++ /dev/null @@ -1,17 +0,0 @@ -from mitmproxy.contentviews import xml -from . import full_eval - - -def test_view_xml(): - v = full_eval(xml.ViewXML()) - assert v(b"<foo></foo>") - assert not v(b"<foo>") - s = b"""<?xml version="1.0" encoding="UTF-8"?> - <?xml-stylesheet title="XSL_formatting"?> - <rss - xmlns:media="http://search.yahoo.com/mrss/" - xmlns:atom="http://www.w3.org/2005/Atom" - version="2.0"> - </rss> - """ - assert v(s) |