From b95cc63b87ea87d9a6105ef72ad1d653c5c01b06 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Mon, 7 Mar 2016 12:13:15 +0530 Subject: [PATCH] Add tests for redirect_requests example --- test/mitmproxy/test_examples.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index c134ec30f..a76d56a81 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"