aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-11-03 15:00:18 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-11-03 15:00:18 +1300
commit9f77c79227f424f48ec16871d7efd451c8de6d47 (patch)
tree43c840852e2478f56e6ee8d138080c475c66aba4 /test
parent43a822198923215b78ae08cef7a63d1ad24e37c7 (diff)
downloadmitmproxy-9f77c79227f424f48ec16871d7efd451c8de6d47.tar.gz
mitmproxy-9f77c79227f424f48ec16871d7efd451c8de6d47.tar.bz2
mitmproxy-9f77c79227f424f48ec16871d7efd451c8de6d47.zip
FileStreamer -> StreamFile
options.wfile -> options.streamfile
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_streamfile.py (renamed from test/mitmproxy/addons/test_filestreamer.py)27
1 files changed, 13 insertions, 14 deletions
diff --git a/test/mitmproxy/addons/test_filestreamer.py b/test/mitmproxy/addons/test_streamfile.py
index 658a0aa8..f63f29c4 100644
--- a/test/mitmproxy/addons/test_filestreamer.py
+++ b/test/mitmproxy/addons/test_streamfile.py
@@ -6,25 +6,25 @@ import os.path
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.tools import dump
-from mitmproxy.addons import filestreamer
+from mitmproxy.addons import streamfile
def test_configure():
- sa = filestreamer.FileStreamer()
+ sa = streamfile.StreamFile()
with taddons.context(options=dump.Options()) as tctx:
with tutils.tmpdir() as tdir:
p = os.path.join(tdir, "foo")
tutils.raises(
exceptions.OptionsError,
- tctx.configure, sa, outfile=(tdir, "ab")
+ tctx.configure, sa, streamfile=(tdir, "ab")
)
tutils.raises(
"invalid filter",
- tctx.configure, sa, outfile=(p, "ab"), filtstr="~~"
+ tctx.configure, sa, streamfile=(p, "ab"), filtstr="~~"
)
tutils.raises(
"invalid mode",
- tctx.configure, sa, outfile=(p, "xx")
+ tctx.configure, sa, streamfile=(p, "xx")
)
@@ -34,36 +34,35 @@ def rd(p):
def test_tcp():
- sa = filestreamer.FileStreamer()
+ sa = streamfile.StreamFile()
with taddons.context() as tctx:
with tutils.tmpdir() as tdir:
p = os.path.join(tdir, "foo")
- tctx.configure(sa, outfile=(p, "wb"))
+ tctx.configure(sa, streamfile=(p, "wb"))
tt = tflow.ttcpflow()
sa.tcp_start(tt)
sa.tcp_end(tt)
- tctx.configure(sa, outfile=None)
+ tctx.configure(sa, streamfile=None)
assert rd(p)
def test_simple():
- sa = filestreamer.FileStreamer()
+ sa = streamfile.StreamFile()
with taddons.context() as tctx:
with tutils.tmpdir() as tdir:
p = os.path.join(tdir, "foo")
- tctx.configure(sa, outfile=(p, "wb"))
+ tctx.configure(sa, streamfile=(p, "wb"))
f = tflow.tflow(resp=True)
sa.request(f)
sa.response(f)
- tctx.configure(sa, outfile=None)
+ tctx.configure(sa, streamfile=None)
assert rd(p)[0].response
- tctx.configure(sa, outfile=(p, "ab"))
+ tctx.configure(sa, streamfile=(p, "ab"))
f = tflow.tflow()
sa.request(f)
- tctx.configure(sa, outfile=None)
+ tctx.configure(sa, streamfile=None)
assert not rd(p)[1].response
-