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

Function tdnsresp

mitmproxy/test/tutils.py:26–51  ·  view source on GitHub ↗
(**kwargs)

Source from the content-addressed store, hash-verified

24
25
26def tdnsresp(**kwargs) -> dns.DNSMessage:
27 default = dict(
28 timestamp=946681201,
29 id=42,
30 query=False,
31 op_code=dns.op_codes.QUERY,
32 authoritative_answer=False,
33 truncation=False,
34 recursion_desired=True,
35 recursion_available=True,
36 reserved=0,
37 response_code=dns.response_codes.NOERROR,
38 questions=[dns.Question("dns.google", dns.types.A, dns.classes.IN)],
39 answers=[
40 dns.ResourceRecord(
41 "dns.google", dns.types.A, dns.classes.IN, 32, b"\x08\x08\x08\x08"
42 ),
43 dns.ResourceRecord(
44 "dns.google", dns.types.A, dns.classes.IN, 32, b"\x08\x08\x04\x04"
45 ),
46 ],
47 authorities=[],
48 additionals=[],
49 )
50 default.update(kwargs)
51 return dns.DNSMessage(**default) # type: ignore
52
53
54def treq(**kwargs) -> http.Request:

Callers 7

tdnsflowFunction · 0.90
test_regularFunction · 0.85
test_reverseFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by 6

test_regularFunction · 0.68
test_reverseFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…