aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_dump.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-12-11 22:26:21 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-12-11 22:26:21 +0100
commit93d4a0132a1f31597fa24a5001c4c2b2cd752b4f (patch)
tree059dc0a16765493604bb3e5045ec47ad4318d64c /test/test_dump.py
parentffb95a1db742d71d7671f9e9c6db552774bb0ead (diff)
parent14a3e0073fe3a9b8103801d400d293186a9dc7f9 (diff)
downloadmitmproxy-93d4a0132a1f31597fa24a5001c4c2b2cd752b4f.tar.gz
mitmproxy-93d4a0132a1f31597fa24a5001c4c2b2cd752b4f.tar.bz2
mitmproxy-93d4a0132a1f31597fa24a5001c4c2b2cd752b4f.zip
Merge pull request #425 from tekii/master
append option added to dump (flow file is open in append mode instead of overwrite)
Diffstat (limited to 'test/test_dump.py')
-rw-r--r--test/test_dump.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test_dump.py b/test/test_dump.py
index e9cb4d33..aa91d262 100644
--- a/test/test_dump.py
+++ b/test/test_dump.py
@@ -143,9 +143,16 @@ class TestDumpMaster:
def test_write(self):
with tutils.tmpdir() as d:
p = os.path.join(d, "a")
- self._dummy_cycle(1, None, "", wfile=p, verbosity=0)
+ self._dummy_cycle(1, None, "", outfile=(p,"wb"), verbosity=0)
assert len(list(flow.FlowReader(open(p,"rb")).stream())) == 1
+ def test_write_append(self):
+ with tutils.tmpdir() as d:
+ p = os.path.join(d, "a.append")
+ self._dummy_cycle(1, None, "", outfile=(p,"wb"), verbosity=0)
+ self._dummy_cycle(1, None, "", outfile=(p,"ab"), verbosity=0)
+ assert len(list(flow.FlowReader(open(p,"rb")).stream())) == 2
+
def test_write_err(self):
tutils.raises(
dump.DumpError,
@@ -153,7 +160,7 @@ class TestDumpMaster:
1,
None,
"",
- wfile = "nonexistentdir/foo"
+ outfile = ("nonexistentdir/foo", "wb")
)
def test_script(self):