diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-08-22 00:59:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 00:59:51 +0200 |
commit | 721f7cc92ecdeb03b3f507077e7ef29d48d833ca (patch) | |
tree | 612d332d0ef2aac63cde2b00b5bef73d3696f61e /test | |
parent | 7e154171bffbe30c990dd4a522bc65a3a72f2975 (diff) | |
parent | bf243244ce3b0c88170484444ce340129b984dee (diff) | |
download | mitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.tar.gz mitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.tar.bz2 mitmproxy-721f7cc92ecdeb03b3f507077e7ef29d48d833ca.zip |
Merge pull request #2540 from mhils/relatively-static
Make it possible to run static viewer in subdirectories
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/tools/web/test_app.py | 10 | ||||
-rw-r--r-- | test/mitmproxy/tools/web/test_static_viewer.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py index aaf949a8..6b88823c 100644 --- a/test/mitmproxy/tools/web/test_app.py +++ b/test/mitmproxy/tools/web/test_app.py @@ -186,7 +186,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): f.response.headers["Content-Encoding"] = "ran\x00dom" f.response.headers["Content-Disposition"] = 'inline; filename="filename.jpg"' - r = self.fetch("/flows/42/response/_content") + r = self.fetch("/flows/42/response/content.data") assert r.body == b"message" assert r.headers["Content-Encoding"] == "random" assert r.headers["Content-Disposition"] == 'attachment; filename="filename.jpg"' @@ -194,17 +194,17 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): del f.response.headers["Content-Disposition"] f.request.path = "/foo/bar.jpg" assert self.fetch( - "/flows/42/response/_content" + "/flows/42/response/content.data" ).headers["Content-Disposition"] == 'attachment; filename=bar.jpg' f.response.content = b"" - assert self.fetch("/flows/42/response/_content").code == 400 + assert self.fetch("/flows/42/response/content.data").code == 400 f.revert() def test_update_flow_content(self): assert self.fetch( - "/flows/42/request/_content", + "/flows/42/request/content.data", method="POST", body="new" ).code == 200 @@ -222,7 +222,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): b'--somefancyboundary--\r\n' ) assert self.fetch( - "/flows/42/request/_content", + "/flows/42/request/content.data", method="POST", headers={"Content-Type": 'multipart/form-data; boundary="somefancyboundary"'}, body=body diff --git a/test/mitmproxy/tools/web/test_static_viewer.py b/test/mitmproxy/tools/web/test_static_viewer.py index 138c3add..5b7ddfff 100644 --- a/test/mitmproxy/tools/web/test_static_viewer.py +++ b/test/mitmproxy/tools/web/test_static_viewer.py @@ -43,9 +43,9 @@ def test_save_flows_content(ctx, tmpdir): for p in flows_path.listdir(): assert p.join('request').check(dir=1) assert p.join('response').check(dir=1) - assert p.join('request/_content').check(file=1) + assert p.join('request/content.data').check(file=1) assert p.join('request/content').check(dir=1) - assert p.join('response/_content').check(file=1) + assert p.join('response/content.data').check(file=1) assert p.join('response/content').check(dir=1) assert p.join('request/content/Auto.json').check(file=1) assert p.join('response/content/Auto.json').check(file=1) |