aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-03-07 12:13:15 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-03-11 17:57:57 +0530
commitb95cc63b87ea87d9a6105ef72ad1d653c5c01b06 (patch)
tree42279c87c277de86c26ae165ff0a3d9e6d878e57
parent2cd5392657d29179e9ddae9f43a849276df030f9 (diff)
downloadmitmproxy-b95cc63b87ea87d9a6105ef72ad1d653c5c01b06.tar.gz
mitmproxy-b95cc63b87ea87d9a6105ef72ad1d653c5c01b06.tar.bz2
mitmproxy-b95cc63b87ea87d9a6105ef72ad1d653c5c01b06.zip
Add tests for redirect_requests example
-rw-r--r--test/mitmproxy/test_examples.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py
index c134ec30..a76d56a8 100644
--- a/test/mitmproxy/test_examples.py
+++ b/test/mitmproxy/test_examples.py
@@ -13,6 +13,7 @@ from examples import (
modify_form,
modify_querystring,
modify_response_body,
+ redirect_requests,
)
@@ -96,3 +97,9 @@ def test_iframe_injector():
content = flow.response.content
assert 'iframe' in content and ctx.iframe_url in content
+
+
+def test_redirect_requests():
+ flow = tutils.tflow(req=netutils.treq(host="example.org"))
+ redirect_requests.request({}, flow)
+ assert flow.request.host == "mitmproxy.org"