'Make L{os.read} appear to return C{readData}, and assert that
L{UnixApplicationRunner.postApplication} writes
C{errorMessage} to standard error and executes the calls
against L{os} functions specified in C{mockOSActions}.'

def assertErrorInParentBehavior(self, readData, errorMessage, mockOSActions):

    self.mockos.child = False
    self.mockos.readData = readData
    errorIO = NativeStringIO()
    self.patch(sys, '__stderr__', errorIO)
    with AlternateReactor(FakeDaemonizingReactor()):
        self.assertRaises(SystemError, self.runner.postApplication)
    self.assertEqual(errorIO.getvalue(), errorMessage)
    self.assertEqual(self.mockos.actions, mockOSActions)
    self.assertEqual(self.mockos.closed, [(-1)])
