Exemplo n.º 1
0
 def test_handle_accept_typeerror(self):
     # https://github.com/giampaolo/pyftpdlib/issues/91
     ac = Acceptor()
     with mock.patch.object(ac, "accept", side_effect=TypeError) as m:
         ac.handle_accept()
         assert m.called
         self.assertIsNone(ac.socket)
Exemplo n.º 2
0
 def test_handle_accept_typeerror(self):
     # https://github.com/giampaolo/pyftpdlib/issues/91
     ac = Acceptor()
     with mock.patch.object(ac, "accept", side_effect=TypeError) as m:
         ac.handle_accept()
         assert m.called
         self.assertIsNone(ac.socket)
Exemplo n.º 3
0
 def test_handle_accept_econnacorted(self):
     # https://github.com/giampaolo/pyftpdlib/issues/105
     ac = Acceptor()
     with mock.patch.object(
             ac, "accept",
             side_effect=socket.error(errno.ECONNABORTED, "")) as m:
         ac.handle_accept()
         assert m.called
         self.assertIsNone(ac.socket)
Exemplo n.º 4
0
 def test_handle_accept_econnacorted(self):
     # https://github.com/giampaolo/pyftpdlib/issues/105
     ac = Acceptor()
     with mock.patch.object(ac,
                            "accept",
                            side_effect=socket.error(
                                errno.ECONNABORTED, "")) as m:
         ac.handle_accept()
         assert m.called
         self.assertIsNone(ac.socket)