MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_dns

Function test_dns

test/mitmproxy/addons/test_intercept.py:47–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46
47async def test_dns():
48 r = intercept.Intercept()
49 with taddons.context(r) as tctx:
50 tctx.configure(r, intercept="~s ~dns")
51
52 f = tflow.tdnsflow(resp=True)
53 await tctx.cycle(r, f)
54 assert f.intercepted
55
56 f = tflow.tdnsflow(resp=False)
57 await tctx.cycle(r, f)
58 assert not f.intercepted
59
60 tctx.configure(r, intercept_active=False)
61 f = tflow.tdnsflow(resp=True)
62 await tctx.cycle(r, f)
63 assert not f.intercepted
64
65
66async def test_tcp():

Callers

nothing calls this directly

Calls 3

contextMethod · 0.80
configureMethod · 0.45
cycleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…