def test_utf8str_write(self): with mozfile.NamedTemporaryFile() as logfile: _fmt = formatters.TbplFormatter() _handler = handlers.StreamHandler(logfile, _fmt) self.logger.add_handler(_handler) self.logger.suite_start([]) self.logger.info("☺") logfile.seek(0) data = logfile.readlines()[-1].strip() self.assertEquals(data, "☺") self.logger.suite_end()
def test_utf8str_write(self): with mozfile.NamedTemporaryFile() as logfile: _fmt = formatters.TbplFormatter() _handler = handlers.StreamHandler(logfile, _fmt) self.logger.add_handler(_handler) self.logger.suite_start([]) self.logger.info("☺") with open(logfile.name) as f: data = f.readlines() self.assertEquals(data[-1], "☺\n") self.logger.suite_end()
def get_formatter(self): return formatters.TbplFormatter()