| 64 | assert '"' not in s.fullpath |
| 65 | |
| 66 | async def test_simple(self, tdata, caplog_async): |
| 67 | caplog_async.set_level("DEBUG") |
| 68 | sc = script.Script( |
| 69 | tdata.path("mitmproxy/data/addonscripts/recorder/recorder.py"), |
| 70 | True, |
| 71 | ) |
| 72 | with taddons.context(sc) as tctx: |
| 73 | tctx.configure(sc) |
| 74 | await caplog_async.await_log("recorder configure") |
| 75 | rec = tctx.master.addons.get("recorder") |
| 76 | |
| 77 | assert rec.call_log[0][0:2] == ("recorder", "load") |
| 78 | |
| 79 | rec.call_log = [] |
| 80 | f = tflow.tflow(resp=True) |
| 81 | tctx.master.addons.trigger(HttpRequestHook(f)) |
| 82 | |
| 83 | assert rec.call_log[0][1] == "request" |
| 84 | sc.done() |
| 85 | |
| 86 | async def test_reload(self, tmp_path, caplog_async): |
| 87 | caplog_async.set_level("INFO") |