def test_write_logline_without_timestamp(self): logfile = StringIO.StringIO() monitors_util.write_logline(logfile, self.msg) logfile.seek(0) written = logfile.read() self.assertEquals( '%s\n' % self.msg, written)
def test_write_logline_with_timestamp(self): logfile = StringIO.StringIO() monitors_util.write_logline(logfile, self.msg, self.format) logfile.seek(0) written = logfile.read() self.assertEquals( '%s\t%s\n' % (self.formatted_time_tuple, self.msg), written)