'If L{FileDescriptor.fileno} returns C{-1}, the descriptor is removed
from the reactor.'

def test_negativeOneFileDescriptor(self):

    reactor = self.buildReactor()
    (client, server) = self._connectedPair()
    class DisappearingDescriptor(FileDescriptor, ):
        _fileno = server.fileno()
        _received = ''
        def fileno(self):
            return self._fileno
        def doRead(self):
            self._fileno = (-1)
            self._received += server.recv(1)
            client.send('y')
        def connectionLost(self, reason):
            reactor.stop()
    descriptor = DisappearingDescriptor(reactor)
    reactor.addReader(descriptor)
    client.send('x')
    self.runReactor(reactor)
    self.assertEqual(descriptor._received, 'x')
