MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_close_code

Function test_close_code

test/mitmproxy/proxy/layers/test_websocket.py:397–412  ·  view source on GitHub ↗
(ws_testdata)

Source from the content-addressed store, hash-verified

395
396
397def test_close_code(ws_testdata):
398 tctx, playbook, flow = ws_testdata
399 assert (
400 playbook
401 << websocket.WebsocketStartHook(flow)
402 >> reply()
403 >> DataReceived(tctx.server, b"\x88\x02\x0f\xa0")
404 << SendData(tctx.server, masked(b"\x88\x02\x0f\xa0"))
405 << CloseConnection(tctx.server)
406 << SendData(tctx.client, b"\x88\x02\x0f\xa0")
407 << CloseConnection(tctx.client)
408 << websocket.WebsocketEndHook(flow)
409 >> reply()
410 )
411 assert flow.websocket.close_code == 4000
412 assert not flow.live
413
414
415def test_deflate(ws_testdata):

Callers

nothing calls this directly

Calls 5

replyClass · 0.90
DataReceivedClass · 0.90
SendDataClass · 0.90
CloseConnectionClass · 0.90
maskedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…