コード例 #1
0
ファイル: test_tcp.py プロジェクト: tdickers/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)
コード例 #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
ファイル: test_tcp.py プロジェクト: tdickers/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)
コード例 #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
ファイル: test_tcp.py プロジェクト: zyh1234/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
     with pytest.raises(exceptions.TcpDisconnect):
         s.read(10)
コード例 #6
0
ファイル: test_tcp.py プロジェクト: zyh1234/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
     with pytest.raises(exceptions.TcpDisconnect):
         s.flush()
コード例 #7
0
ファイル: test_tcp.py プロジェクト: s4chin/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
     with pytest.raises(exceptions.TcpDisconnect):
         s.read(10)
コード例 #8
0
ファイル: test_tcp.py プロジェクト: s4chin/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
     with pytest.raises(exceptions.TcpDisconnect):
         s.flush()