(self)
| 125 | assert s.flows[0].request.host == "use-this-domain" |
| 126 | |
| 127 | async def test_all(self): |
| 128 | opts = options.Options(mode=["reverse:https://use-this-domain"]) |
| 129 | s = State() |
| 130 | with taddons.context(s, options=opts) as ctx: |
| 131 | f = tflow.tflow(req=None) |
| 132 | await ctx.master.addons.handle_lifecycle( |
| 133 | server_hooks.ClientConnectedHook(f.client_conn) |
| 134 | ) |
| 135 | f.request = mitmproxy.test.tutils.treq() |
| 136 | await ctx.master.addons.handle_lifecycle(layers.http.HttpRequestHook(f)) |
| 137 | assert len(s.flows) == 1 |
| 138 | |
| 139 | f.response = mitmproxy.test.tutils.tresp() |
| 140 | await ctx.master.addons.handle_lifecycle(layers.http.HttpResponseHook(f)) |
| 141 | assert len(s.flows) == 1 |
| 142 | |
| 143 | await ctx.master.addons.handle_lifecycle( |
| 144 | server_hooks.ClientDisconnectedHook(f.client_conn) |
| 145 | ) |
| 146 | |
| 147 | f.error = flow.Error("msg") |
| 148 | await ctx.master.addons.handle_lifecycle(layers.http.HttpErrorHook(f)) |
| 149 | |
| 150 | |
| 151 | class TestError: |
nothing calls this directly
no test coverage detected