예제 #1
0
 def test_reader_read_error(self):
     s = BytesIO(b"foobar\nfoobar")
     s = tcp.Reader(s)
     o = mock.MagicMock()
     o.read = mock.MagicMock(side_effect=socket.error)
     s.o = o
     tutils.raises(TcpDisconnect, s.read, 10)
예제 #2
0
파일: test_tcp.py 프로젝트: bemre/mitmproxy
 def test_reader_read_error(self):
     s = BytesIO(b"foobar\nfoobar")
     s = tcp.Reader(s)
     o = mock.MagicMock()
     o.read = mock.MagicMock(side_effect=socket.error)
     s.o = o
     tutils.raises(TcpDisconnect, s.read, 10)
예제 #3
0
 def test_writer_flush_error(self):
     s = BytesIO()
     s = tcp.Writer(s)
     o = mock.MagicMock()
     o.flush = mock.MagicMock(side_effect=socket.error)
     s.o = o
     tutils.raises(TcpDisconnect, s.flush)
예제 #4
0
파일: test_tcp.py 프로젝트: bemre/mitmproxy
 def test_writer_flush_error(self):
     s = BytesIO()
     s = tcp.Writer(s)
     o = mock.MagicMock()
     o.flush = mock.MagicMock(side_effect=socket.error)
     s.o = o
     tutils.raises(TcpDisconnect, s.flush)
예제 #5
0
 def test_reader_read_error(self):
     s = BytesIO(b"foobar\nfoobar")
     s = tcp.Reader(s)
     o = mock.MagicMock()
     o.read = mock.MagicMock(side_effect=socket.error)
     s.o = o
     with pytest.raises(exceptions.TcpDisconnect):
         s.read(10)
예제 #6
0
 def test_writer_flush_error(self):
     s = BytesIO()
     s = tcp.Writer(s)
     o = mock.MagicMock()
     o.flush = mock.MagicMock(side_effect=socket.error)
     s.o = o
     with pytest.raises(exceptions.TcpDisconnect):
         s.flush()
예제 #7
0
 def test_reader_read_error(self):
     s = BytesIO(b"foobar\nfoobar")
     s = tcp.Reader(s)
     o = mock.MagicMock()
     o.read = mock.MagicMock(side_effect=socket.error)
     s.o = o
     with pytest.raises(exceptions.TcpDisconnect):
         s.read(10)
예제 #8
0
 def test_writer_flush_error(self):
     s = BytesIO()
     s = tcp.Writer(s)
     o = mock.MagicMock()
     o.flush = mock.MagicMock(side_effect=socket.error)
     s.o = o
     with pytest.raises(exceptions.TcpDisconnect):
         s.flush()