'If the JSON text for a record contains invalid UTF-8 text, ignore that
record.'

def test_readInvalidUTF8Bytes(self):

    with BytesIO('\x1e{"x":    "\xe2\xac"}\n\x1e{"y":    2}\n') as fileHandle:
        events = eventsFromJSONLogFile(fileHandle)
        self.assertEqual(next(events), {u'y': 2})
        self.assertRaises(StopIteration, next, events)
        self.assertEqual(len(self.errorEvents), 1)
        self.assertEqual(self.errorEvents[0]['log_format'], u'Unable    to    decode    UTF-8    for    JSON    record:    {record!r}')
        self.assertEqual(self.errorEvents[0]['record'], '{"x":    "\xe2\xac"}\n')
