MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_websocket

Function test_websocket

test/mitmproxy/addons/test_save.py:98–113  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

96
97
98def test_websocket(tmp_path):
99 sa = save.Save()
100 with taddons.context(sa) as tctx:
101 p = str(tmp_path / "foo")
102 tctx.configure(sa, save_stream_file=p)
103
104 f = tflow.twebsocketflow()
105 sa.request(f)
106 sa.websocket_end(f)
107
108 f = tflow.twebsocketflow()
109 sa.request(f)
110 sa.websocket_end(f)
111
112 tctx.configure(sa, save_stream_file=None)
113 assert len(rd(p)) == 2
114
115
116def test_save_command(tmp_path):

Callers

nothing calls this directly

Calls 5

requestMethod · 0.95
websocket_endMethod · 0.95
contextMethod · 0.80
rdFunction · 0.70
configureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…