'When the _errFlag is set to L{StandardErrorBehavior.LOG},
L{endpoints._WrapIProtocol} logs stderr (in childDataReceived).'

def test_logStderr(self):

    d = self.ep.connect(self.factory)
    self.successResultOf(d)
    wpp = self.reactor.processProtocol
    log.addObserver(self._stdLog)
    self.addCleanup(log.removeObserver, self._stdLog)
    wpp.childDataReceived(2, 'stderr1')
    self.assertEqual(self.eventLog['executable'], wpp.executable)
    self.assertEqual(self.eventLog['data'], 'stderr1')
    self.assertEqual(self.eventLog['protocol'], wpp.protocol)
    self.assertIn('wrote    stderr    unhandled    by', log.textFromEventDict(self.eventLog))
