MCPcopy
hub / github.com/mitmproxy/mitmproxy / get_app

Method get_app

test/mitmproxy/tools/web/test_app.py:56–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54@pytest.mark.usefixtures("no_tornado_logging", "tdata")
55class TestApp(tornado.testing.AsyncHTTPTestCase):
56 def get_app(self):
57 async def make_master() -> webmaster.WebMaster:
58 o = options.Options(http2=False)
59 return webmaster.WebMaster(o, with_termlog=False)
60
61 m: webmaster.WebMaster = self.io_loop.asyncio_loop.run_until_complete(
62 make_master()
63 )
64 f = tflow.tflow(resp=True)
65 f.id = "42"
66 f.request.content = b"foo\nbar"
67 f2 = tflow.tflow(ws=True, resp=True)
68 f2.request.content = None
69 f2.response.content = None
70 f2.id = "43"
71 m.view.add([f, f2])
72 m.view.add([tflow.tflow(err=True)])
73 m.events._add_log(log.LogEntry("test log", "info"))
74 m.events.done()
75 self.master = m
76 self.view = m.view
77 self.events = m.events
78 webapp = app.Application(m, None)
79 webapp.settings["xsrf_cookies"] = False
80 return webapp
81
82 @property
83 def auth_cookie(self) -> str:

Callers

nothing calls this directly

Calls 3

_add_logMethod · 0.80
addMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected