mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
Pretty view now indents Javascript.
Thanks to the JSBeautifier project, which is now included in the contrib directory.
This commit is contained in:
@@ -9,7 +9,7 @@ class uContentView(libpry.AutoTree):
|
||||
assert not txt
|
||||
cv.trailer(cv.VIEW_CUTOFF + 10, txt)
|
||||
assert txt
|
||||
|
||||
|
||||
def test_get_view_func(self):
|
||||
f = cv.get_view_func(
|
||||
cv.VIEW_CONTENT_HEX,
|
||||
@@ -75,6 +75,11 @@ class uContentView(libpry.AutoTree):
|
||||
def test_view_raw(self):
|
||||
assert cv.view_raw([], "foo")
|
||||
|
||||
def test_view_javascript(self):
|
||||
assert cv.view_javascript([], "[1, 2, 3]")
|
||||
assert cv.view_javascript([], "[1, 2, 3")
|
||||
assert cv.view_javascript([], "function(a){[1, 2, 3]}")
|
||||
|
||||
def test_view_raw(self):
|
||||
assert cv.view_hex([], "foo")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user