MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_stdin

Method test_stdin

test/mitmproxy/addons/test_readfile.py:98–109  ·  view source on GitHub ↗
(self, stdin, data, corrupt_data)

Source from the content-addressed store, hash-verified

96class TestReadFileStdin:
97 @mock.patch("sys.stdin")
98 async def test_stdin(self, stdin, data, corrupt_data):
99 rf = readfile.ReadFileStdin()
100 with taddons.context(rf):
101 with mock.patch("mitmproxy.master.Master.load_flow") as mck:
102 stdin.buffer = data
103 mck.assert_not_awaited()
104 await rf.load_flows(stdin.buffer)
105 mck.assert_awaited()
106
107 stdin.buffer = corrupt_data
108 with pytest.raises(exceptions.FlowReadException):
109 await rf.load_flows(stdin.buffer)
110
111 async def test_normal(self, tmpdir, data):
112 rf = readfile.ReadFileStdin()

Callers

nothing calls this directly

Calls 2

contextMethod · 0.80
load_flowsMethod · 0.45

Tested by

no test coverage detected