示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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)
示例#5
0
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)
示例#6
0
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)