'If the process communicating with L{CGIProcessProtocol} ends before
finishing writing out headers, the response has I{INTERNAL SERVER
ERROR} as its status code.'

def test_prematureEndOfHeaders(self):

    request = DummyRequest([''])
    protocol = twcgi.CGIProcessProtocol(request)
    protocol.processEnded(failure.Failure(error.ProcessTerminated()))
    self.assertEqual(request.responseCode, INTERNAL_SERVER_ERROR)
