'If the JSON text for a record is truncated in the middle of a two-byte
Unicode codepoint, we don\'t want to see a codec exception and the
stream is read properly when the additional data arrives.'

def test_readTruncatedUTF8Bytes(self):

    with BytesIO('\x1e{"x":    "\xe2\x82\xac"}\n') as fileHandle:
        events = eventsFromJSONLogFile(fileHandle, bufferSize=8)
        self.assertEqual(next(events), {u'x': u'\u20ac'})
        self.assertRaises(StopIteration, next, events)
        self.assertEqual(len(self.errorEvents), 0)
