(self, stdin, data, corrupt_data)
| 96 | class 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() |
nothing calls this directly
no test coverage detected