aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-02-24 15:00:40 +1300
committerAldo Cortesi <aldo@nullcube.com>2018-02-24 15:00:40 +1300
commit52c8d7e0f8d86a096946f001f81cd938f3e54b88 (patch)
tree6fe9e59be74eb39c6dd5ee8306439ec39bf86e95 /test
parent74a0230788f1e3a1800d8125fca274cda402c769 (diff)
downloadmitmproxy-52c8d7e0f8d86a096946f001f81cd938f3e54b88.tar.gz
mitmproxy-52c8d7e0f8d86a096946f001f81cd938f3e54b88.tar.bz2
mitmproxy-52c8d7e0f8d86a096946f001f81cd938f3e54b88.zip
addon options: shift server_replay options
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_serverplayback.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/mitmproxy/addons/test_serverplayback.py b/test/mitmproxy/addons/test_serverplayback.py
index 32249a88..0bc28ac8 100644
--- a/test/mitmproxy/addons/test_serverplayback.py
+++ b/test/mitmproxy/addons/test_serverplayback.py
@@ -19,7 +19,7 @@ def tdump(path, flows):
def test_load_file(tmpdir):
s = serverplayback.ServerPlayback()
- with taddons.context():
+ with taddons.context(s):
fpath = str(tmpdir.join("flows"))
tdump(fpath, [tflow.tflow(resp=True)])
s.load_file(fpath)
@@ -30,7 +30,7 @@ def test_load_file(tmpdir):
def test_config(tmpdir):
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
fpath = str(tmpdir.join("flows"))
tdump(fpath, [tflow.tflow(resp=True)])
tctx.configure(s, server_replay=[fpath])
@@ -41,7 +41,7 @@ def test_config(tmpdir):
def test_tick():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
s.stop = True
s.final_flow = tflow.tflow()
s.final_flow.live = False
@@ -51,7 +51,7 @@ def test_tick():
def test_server_playback():
sp = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(sp) as tctx:
tctx.configure(sp)
f = tflow.tflow(resp=True)
@@ -70,7 +70,7 @@ def test_server_playback():
def test_ignore_host():
sp = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(sp) as tctx:
tctx.configure(sp, server_replay_ignore_host=True)
r = tflow.tflow(resp=True)
@@ -85,7 +85,7 @@ def test_ignore_host():
def test_ignore_content():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(s, server_replay_ignore_content=False)
r = tflow.tflow(resp=True)
@@ -113,7 +113,7 @@ def test_ignore_content():
def test_ignore_content_wins_over_params():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(
s,
server_replay_ignore_content=True,
@@ -137,7 +137,7 @@ def test_ignore_content_wins_over_params():
def test_ignore_payload_params_other_content_type():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(
s,
server_replay_ignore_content=False,
@@ -161,7 +161,7 @@ def test_ignore_payload_params_other_content_type():
def test_hash():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(s)
r = tflow.tflow()
@@ -181,7 +181,7 @@ def test_hash():
def test_headers():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(s, server_replay_use_headers=["foo"])
r = tflow.tflow(resp=True)
@@ -200,7 +200,7 @@ def test_headers():
def test_load():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(s)
r = tflow.tflow(resp=True)
@@ -227,7 +227,7 @@ def test_load():
def test_load_with_server_replay_nopop():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(s, server_replay_nopop=True)
r = tflow.tflow(resp=True)
@@ -245,7 +245,7 @@ def test_load_with_server_replay_nopop():
def test_ignore_params():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(
s,
server_replay_ignore_params=["param1", "param2"]
@@ -266,7 +266,7 @@ def test_ignore_params():
def thash(r, r2, setter):
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
s = serverplayback.ServerPlayback()
tctx.configure(
s,
@@ -328,7 +328,7 @@ def test_ignore_payload_params():
def test_server_playback_full():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(
s,
server_replay_refresh = True,
@@ -360,7 +360,7 @@ def test_server_playback_full():
def test_server_playback_kill():
s = serverplayback.ServerPlayback()
- with taddons.context() as tctx:
+ with taddons.context(s) as tctx:
tctx.configure(
s,
server_replay_refresh = True,