(self, tdata, caplog_async)
| 176 | |
| 177 | class TestScriptLoader: |
| 178 | async def test_script_run(self, tdata, caplog_async): |
| 179 | caplog_async.set_level("DEBUG") |
| 180 | rp = tdata.path("mitmproxy/data/addonscripts/recorder/recorder.py") |
| 181 | sc = script.ScriptLoader() |
| 182 | with taddons.context(sc): |
| 183 | sc.script_run([tflow.tflow(resp=True)], rp) |
| 184 | await caplog_async.await_log("recorder response") |
| 185 | debug = [ |
| 186 | i.msg for i in caplog_async.caplog.records if i.levelname == "DEBUG" |
| 187 | ] |
| 188 | assert debug == [ |
| 189 | "recorder configure", |
| 190 | "recorder running", |
| 191 | "recorder requestheaders", |
| 192 | "recorder request", |
| 193 | "recorder responseheaders", |
| 194 | "recorder response", |
| 195 | ] |
| 196 | |
| 197 | async def test_script_run_nonexistent(self, caplog): |
| 198 | sc = script.ScriptLoader() |
nothing calls this directly
no test coverage detected