MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_responses

Method test_responses

test/mitmproxy/test_dns.py:186–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

184 )
185
186 def test_responses(self):
187 req = tutils.tdnsreq()
188 resp = tutils.tdnsresp()
189 resp2 = req.succeed(
190 [
191 dns.ResourceRecord.A(
192 "dns.google", ipaddress.IPv4Address("8.8.8.8"), ttl=32
193 ),
194 dns.ResourceRecord.A(
195 "dns.google", ipaddress.IPv4Address("8.8.4.4"), ttl=32
196 ),
197 ]
198 )
199 resp2.timestamp = resp.timestamp
200 assert resp == resp2
201 assert resp2.size == 8
202 with pytest.raises(ValueError):
203 req.fail(dns.response_codes.NOERROR)
204 assert (
205 req.fail(dns.response_codes.FORMERR).response_code
206 == dns.response_codes.FORMERR
207 )
208
209 def test_range(self):
210 def test(what: str, min: int, max: int):

Callers

nothing calls this directly

Calls 3

succeedMethod · 0.80
AMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected