diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index 16607a1b4..8b6e0eabb 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -7,6 +7,7 @@ from netlib.http import Headers from . import tservers, tutils from examples import ( + add_header, modify_form, ) @@ -38,6 +39,12 @@ def test_load_scripts(): s.unload() +def test_add_header(): + flow = tutils.tflow(resp=netutils.tresp()) + add_header.response({}, flow) + assert flow.response.headers["newheader"] == "foo" + + def test_modify_form(): form_header = Headers(content_type="application/x-www-form-urlencoded") flow = tutils.tflow(req=netutils.treq(headers=form_header))