aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_console_contentview.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-04-07 22:15:31 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-04-07 22:15:31 +1200
commita4f7728fadd85ba1da92e6c920256b2b4ba8cf0d (patch)
tree16ee86ab7838eebd5555f4bdd6562796bb8f3dc0 /test/test_console_contentview.py
parentf1dc3f2ab2d78ce2bc1a0418239fa6fa1f6c4429 (diff)
downloadmitmproxy-a4f7728fadd85ba1da92e6c920256b2b4ba8cf0d.tar.gz
mitmproxy-a4f7728fadd85ba1da92e6c920256b2b4ba8cf0d.tar.bz2
mitmproxy-a4f7728fadd85ba1da92e6c920256b2b4ba8cf0d.zip
XML/HTML pretty view tweaks.
Diffstat (limited to 'test/test_console_contentview.py')
-rw-r--r--test/test_console_contentview.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py
index cf2ab1e5..e0dbd577 100644
--- a/test/test_console_contentview.py
+++ b/test/test_console_contentview.py
@@ -32,7 +32,7 @@ class uContentView(libpry.AutoTree):
),
"foo"
)
- assert f is cv.view_xmlish
+ assert f is cv.view_html
f = cv.get_view_func(
cv.VIEW_AUTO,
@@ -50,7 +50,7 @@ class uContentView(libpry.AutoTree):
),
"<xml></xml>"
)
- assert f is cv.view_xmlish
+ assert f is cv.view_xml
def test_view_urlencoded(self):
d = utils.urlencode([("one", "two"), ("three", "four")])
@@ -71,18 +71,17 @@ class uContentView(libpry.AutoTree):
assert cv.view_json([], "[" + ",".join(["0"]*cv.VIEW_CUTOFF) + "]")
def test_view_xml(self):
- #assert cv.view_xml([], "<foo></foo>")
- #assert not cv.view_xml([], "<foo>")
-
+ assert cv.view_xml([], "<foo></foo>")
+ assert not cv.view_xml([], "<foo>")
s = """<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet title="XSL_formatting"?>
- <rss
+ <rss
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom"
version="2.0">
</rss>
"""
- print cv.view_xml([], s)
+ assert cv.view_xml([], s)
def test_view_raw(self):
assert cv.view_raw([], "foo")
@@ -170,7 +169,7 @@ Larry
encoding.encode('gzip', "[1, 2, 3]")
)
assert "decoded gzip" in r[0]
- assert "XML" in r[0]
+ assert "Raw" in r[0]
tests = [