Пример #1
0
def test_get_timestamp_3():
    test_string = '''127.0.0.1 - - [31/Oct/2015:11:00:13 +0000]
    [1446314353.403] "GET /index.html HTTP/1.1" 200 54510 "-" 
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) 
    AppleWebKit/537.36 (KHTML,'''

    test_timestamp = "1446314353.403"
    assert reican.get_timestamp(test_string)[0] == test_timestamp
Пример #2
0
def test_get_timestamp_2():
    test_string = "[2015-10-31 13:54:42.146481] DEBUG: Reican: Using gzip to open the file"
    test_timestamp = "2015-10-31 13:54:42.146481"
    assert reican.get_timestamp(test_string)[0] == test_timestamp
Пример #3
0
def test_get_timestamp_1():
    test_string = "2015-10-30T20:20:11.563278+00:00 lalala lalalalalallalalal"
    test_timestamp = "2015-10-30T20:20:11.563278+00:00"
    assert reican.get_timestamp(test_string)[0] == test_timestamp
Пример #4
0
def test_get_timestamp_4():
    test_string = "2015.11.01 15:04:39 #72651112 SERVER: some stuff happened here"
    test_timestamp = "2015.11.01 15:04:39"
    assert reican.get_timestamp(test_string)[0] == test_timestamp