diff options
author | Marcelo Glezer <mg@tekii.com.ar> | 2014-12-11 15:21:33 -0300 |
---|---|---|
committer | Marcelo Glezer <mg@tekii.com.ar> | 2014-12-11 15:21:33 -0300 |
commit | 14a3e0073fe3a9b8103801d400d293186a9dc7f9 (patch) | |
tree | 059dc0a16765493604bb3e5045ec47ad4318d64c /test | |
parent | 4952643a0d76eb1e9bd51cbbe95c565ae48b97a2 (diff) | |
download | mitmproxy-14a3e0073fe3a9b8103801d400d293186a9dc7f9.tar.gz mitmproxy-14a3e0073fe3a9b8103801d400d293186a9dc7f9.tar.bz2 mitmproxy-14a3e0073fe3a9b8103801d400d293186a9dc7f9.zip |
append file mode for saving flows merged to master
Diffstat (limited to 'test')
-rw-r--r-- | test/test_dump.py | 11 |
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): |