MCPcopy
hub / github.com/mitmproxy/mitmproxy / ws_testdata

Function ws_testdata

test/mitmproxy/proxy/layers/test_websocket.py:203–224  ·  view source on GitHub ↗
(tctx)

Source from the content-addressed store, hash-verified

201
202@pytest.fixture()
203def ws_testdata(tctx):
204 tctx.server.address = ("example.com", 80)
205 tctx.server.state = ConnectionState.OPEN
206 flow = HTTPFlow(tctx.client, tctx.server)
207 flow.request = Request.make(
208 "GET",
209 "http://example.com/",
210 headers={
211 "Connection": "upgrade",
212 "Upgrade": "websocket",
213 "Sec-WebSocket-Version": "13",
214 },
215 )
216 flow.response = Response.make(
217 101,
218 headers={
219 "Connection": "upgrade",
220 "Upgrade": "websocket",
221 },
222 )
223 flow.websocket = WebSocketData()
224 return tctx, Playbook(websocket.WebsocketLayer(tctx, flow)), flow
225
226
227def test_modify_message(ws_testdata):

Callers

nothing calls this directly

Calls 4

HTTPFlowClass · 0.90
WebSocketDataClass · 0.90
PlaybookClass · 0.90
makeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…