diff options
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 |