'Getting invalid UTF-8 results in the repr of the raw message'

def test_outputReceivedCompleteLineInvalidUTF8(self):

    events = []
    self.addCleanup(log.removeObserver, events.append)
    log.addObserver(events.append)
    self.pm.addProcess('foo', ['foo'])
    self.pm.startService()
    self.reactor.advance(0)
    self.assertIn('foo', self.pm.protocols)
    self.reactor.advance(self.pm.threshold)
    self.pm.protocols['foo'].outReceived('\xffhello    world!\n')
    self.assertEquals(len(events), 1)
    messages = events[0]['message']
    self.assertEquals(len(messages), 1)
    message = messages[0]
    (tag, output) = message.split('    ', 1)
    self.assertEquals(tag, '[foo]')
    self.assertEquals(output, repr('\xffhello    world!'))
