diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2017-04-27 15:58:54 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2017-04-27 15:58:54 +1200 |
commit | b7afcb5dc2007ce451161e513d3e55d4cc91379e (patch) | |
tree | c657a3b8d2f187a37f59ad05c029341568482136 /test | |
parent | 8c4810f6069bcf592d480e5cc2d7338cd176085e (diff) | |
download | mitmproxy-b7afcb5dc2007ce451161e513d3e55d4cc91379e.tar.gz mitmproxy-b7afcb5dc2007ce451161e513d3e55d4cc91379e.tar.bz2 mitmproxy-b7afcb5dc2007ce451161e513d3e55d4cc91379e.zip |
addons.streamfile -> addons.save
Options:
streamfile -> save_stream_file
streamfile_filter -> save_stream_filter
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_save.py (renamed from test/mitmproxy/addons/test_streamfile.py) | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/mitmproxy/addons/test_streamfile.py b/test/mitmproxy/addons/test_save.py index bcb27c79..fcd2feab 100644 --- a/test/mitmproxy/addons/test_streamfile.py +++ b/test/mitmproxy/addons/test_save.py @@ -6,21 +6,21 @@ from mitmproxy.test import tflow from mitmproxy import io from mitmproxy import exceptions from mitmproxy import options -from mitmproxy.addons import streamfile +from mitmproxy.addons import save def test_configure(tmpdir): - sa = streamfile.StreamFile() + sa = save.Save() with taddons.context(options=options.Options()) as tctx: with pytest.raises(exceptions.OptionsError): - tctx.configure(sa, streamfile=str(tmpdir)) + tctx.configure(sa, save_stream_file=str(tmpdir)) with pytest.raises(Exception, match="Invalid filter"): tctx.configure( - sa, streamfile=str(tmpdir.join("foo")), streamfile_filter="~~" + sa, save_stream_file=str(tmpdir.join("foo")), save_stream_filter="~~" ) - tctx.configure(sa, streamfile_filter="foo") + tctx.configure(sa, save_stream_filter="foo") assert sa.filt - tctx.configure(sa, streamfile_filter=None) + tctx.configure(sa, save_stream_filter=None) assert not sa.filt @@ -30,33 +30,33 @@ def rd(p): def test_tcp(tmpdir): - sa = streamfile.StreamFile() + sa = save.Save() with taddons.context() as tctx: p = str(tmpdir.join("foo")) - tctx.configure(sa, streamfile=p) + tctx.configure(sa, save_stream_file=p) tt = tflow.ttcpflow() sa.tcp_start(tt) sa.tcp_end(tt) - tctx.configure(sa, streamfile=None) + tctx.configure(sa, save_stream_file=None) assert rd(p) def test_simple(tmpdir): - sa = streamfile.StreamFile() + sa = save.Save() with taddons.context() as tctx: p = str(tmpdir.join("foo")) - tctx.configure(sa, streamfile=p) + tctx.configure(sa, save_stream_file=p) f = tflow.tflow(resp=True) sa.request(f) sa.response(f) - tctx.configure(sa, streamfile=None) + tctx.configure(sa, save_stream_file=None) assert rd(p)[0].response - tctx.configure(sa, streamfile="+" + p) + tctx.configure(sa, save_stream_file="+" + p) f = tflow.tflow() sa.request(f) - tctx.configure(sa, streamfile=None) + tctx.configure(sa, save_stream_file=None) assert not rd(p)[1].response |