def testLogNone(self):
     stream = StringIO()
     logger = StreamEventLogger(stream)
     logger.logError(None)
     logger.logLine(None, None)
     lines = []
     stream.seek(0)
     for line in stream:
         lines.append(line[DATELENGTH:])
     self.assertEquals(['ERROR\t[]\tNone\n', 'None\t[]\tNone\n'],lines)
 def testTestStreamLog(self):
     stream = StringIO()
     logger = StreamEventLogger(stream)
     logger.logLine('BLA','something')
     logger.logError('this should not happen.')
     lines = []
     stream.seek(0)
     for line in stream:
         lines.append(line.strip()[DATELENGTH:])
     self.assertEquals(['BLA\t[]\tsomething','ERROR\t[]\tthis should not happen.'],lines)