MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_reuse_error

Function test_reuse_error

test/mitmproxy/proxy/layers/http/test_http.py:1495–1504  ·  view source on GitHub ↗

Test that an errored connection is reused.

(tctx)

Source from the content-addressed store, hash-verified

1493
1494
1495def test_reuse_error(tctx):
1496 """Test that an errored connection is reused."""
1497 tctx.server.address = ("example.com", 443)
1498 tctx.server.error = "tls verify failed"
1499 assert (
1500 Playbook(http.HttpLayer(tctx, HTTPMode.transparent), hooks=False)
1501 >> DataReceived(tctx.client, b"GET / HTTP/1.1\r\n\r\n")
1502 << SendData(tctx.client, BytesMatching(b"502 Bad Gateway.+tls verify failed"))
1503 << CloseConnection(tctx.client)
1504 )
1505
1506
1507def test_transparent_sni(tctx):

Callers

nothing calls this directly

Calls 5

PlaybookClass · 0.90
DataReceivedClass · 0.90
SendDataClass · 0.90
BytesMatchingFunction · 0.90
CloseConnectionClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…