mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Add tests for add_header example
This commit is contained in:
parent
a2274f52e4
commit
96df077d54
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user