MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_tunnel_openconnection_error

Function test_tunnel_openconnection_error

test/mitmproxy/proxy/test_tunnel.py:179–198  ·  view source on GitHub ↗
(tctx: Context)

Source from the content-addressed store, hash-verified

177
178
179def test_tunnel_openconnection_error(tctx: Context):
180 server = Server(address=("proxy", 1234))
181
182 tl = TTunnelLayer(tctx, server, tctx.server)
183 tl.child_layer = TChildLayer(tctx)
184
185 playbook = Playbook(tl, logs=True)
186 assert (
187 playbook
188 << Log("Got start. Server state: CLOSED")
189 >> DataReceived(tctx.client, b"open")
190 << OpenConnection(server)
191 )
192 assert tl.tunnel_state is tunnel.TunnelState.ESTABLISHING
193 assert (
194 playbook
195 >> reply("IPoAC packet dropped.")
196 << Log("Opened: err='IPoAC packet dropped.'. Server state: CLOSED")
197 )
198 assert tl.tunnel_state is tunnel.TunnelState.CLOSED
199
200
201@pytest.mark.parametrize("disconnect", ["client", "server"])

Callers

nothing calls this directly

Calls 8

ServerClass · 0.90
PlaybookClass · 0.90
LogClass · 0.90
DataReceivedClass · 0.90
OpenConnectionClass · 0.90
replyClass · 0.90
TTunnelLayerClass · 0.85
TChildLayerClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…