(exception, log_message, tmpdir, caplog)
| 145 | ], |
| 146 | ) |
| 147 | async def test_cut_save_open(exception, log_message, tmpdir, caplog): |
| 148 | f = str(tmpdir.join("path")) |
| 149 | v = view.View() |
| 150 | c = cut.Cut() |
| 151 | with taddons.context() as tctx: |
| 152 | tctx.master.addons.add(v, c) |
| 153 | v.add([tflow.tflow(resp=True)]) |
| 154 | |
| 155 | with mock.patch("mitmproxy.addons.cut.open") as m: |
| 156 | m.side_effect = exception(log_message) |
| 157 | tctx.command(c.save, "@all", "request.method", f) |
| 158 | assert log_message in caplog.text |
| 159 | |
| 160 | |
| 161 | def test_cut(): |