'If a tuple is passed to C{usePTY} to specify slave and master file
descriptors and that C{os.fork} raises an exception, these file
descriptors aren\'t closed.'

def test_mockForkErrorPTYGivenFDs(self):

    self.mockos.raiseFork = OSError(errno.EAGAIN, None)
    protocol = TrivialProcessProtocol(None)
    self.assertRaises(OSError, reactor.spawnProcess, protocol, None, usePTY=((-20), (-21), 'foo'))
    self.assertEqual(self.mockos.actions, [('fork', False)])
    self.assertEqual(self.mockos.closed, [])
