def test_find_getstampproc_unicode(): assert find_getstampproc(pacemaker_unicode_log) == "syslog" with open(evil_unicode_log, 'wb') as f: f.write(invalid_utf8) assert find_getstampproc(evil_unicode_log) == "syslog" os.remove(evil_unicode_log)
def test_find_getstampproc_unicode(): eq_(find_getstampproc(pacemaker_unicode_log), "syslog") with open(evil_unicode_log, 'wb') as f: f.write(invalid_utf8) eq_(find_getstampproc(evil_unicode_log), "syslog") os.remove(evil_unicode_log)
def test_find_getstampproc(): temp_file = create_tempfile() in_string1 = """abcd efg""" with open(temp_file, 'w') as f: f.write(in_string1) assert not find_getstampproc(temp_file) in_string2 = """%s %s""" % (line5424_1, line5424_2) with open(temp_file, 'w') as f: f.write(in_string2) assert find_getstampproc(temp_file) == "rfc5424" in_string3 = """%s %s""" % (linesyslog_1, linesyslog_2) with open(temp_file, 'w') as f: f.write(in_string3) assert find_getstampproc(temp_file) == "syslog" os.remove(temp_file)
def test_find_getstampproc(): temp_file = create_tempfile() in_string1 = """abcd efg""" with open(temp_file, 'w') as f: f.write(in_string1) ok_(not find_getstampproc(temp_file)) in_string2 = """%s %s""" % (line5424_1, line5424_2) with open(temp_file, 'w') as f: f.write(in_string2) eq_(find_getstampproc(temp_file), "rfc5424") in_string3 = """%s %s""" % (linesyslog_1, linesyslog_2) with open(temp_file, 'w') as f: f.write(in_string3) eq_(find_getstampproc(temp_file), "syslog") os.remove(temp_file)