示例#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)
示例#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)
示例#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)
示例#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)