'An implementation of L{IReactorSocket.adoptStreamPort} raises
L{socket.error} if passed an integer which is not associated with a
socket.'

def test_invalidDescriptor(self):

    reactor = self.buildReactor()
    probe = socket.socket()
    fileno = probe.fileno()
    probe.close()
    exc = self.assertRaises(socket.error, reactor.adoptStreamPort, fileno, socket.AF_INET, ServerFactory())
    if (platform.isWindows() and _PY3):
        self.assertEqual(exc.args[0], errno.WSAENOTSOCK)
    else:
        self.assertEqual(exc.args[0], errno.EBADF)
