コード例 #1
0
ファイル: test_cmds_logs.py プロジェクト: ashwinaj/paasta
def test_extract_utc_timestamp_from_log_line_when_invalid_date_format():
    line = 'Jul 22 10:39:08 this is a fake invalid syslog message'
    assert not logs.extract_utc_timestamp_from_log_line(line)
コード例 #2
0
ファイル: test_cmds_logs.py プロジェクト: ashwinaj/paasta
def test_extract_utc_timestamp_from_log_line_when_missing_date():
    line = 'this is a fake invalid syslog message'
    assert not logs.extract_utc_timestamp_from_log_line(line)
コード例 #3
0
ファイル: test_cmds_logs.py プロジェクト: ashwinaj/paasta
def test_extract_utc_timestamp_from_log_line_ok():
    fake_timestamp = '2015-07-22T10:38:46-07:00'
    fake_utc_timestamp = isodate.parse_datetime('2015-07-22T17:38:46.000000')

    line = '%s this is a fake syslog test message' % fake_timestamp
    assert logs.extract_utc_timestamp_from_log_line(line) == fake_utc_timestamp
コード例 #4
0
ファイル: test_cmds_logs.py プロジェクト: georgekola/paasta
def test_extract_utc_timestamp_from_log_line_when_invalid_date_format():
    line = 'Jul 22 10:39:08 this is a fake invalid syslog message'
    assert not logs.extract_utc_timestamp_from_log_line(line)
コード例 #5
0
ファイル: test_cmds_logs.py プロジェクト: georgekola/paasta
def test_extract_utc_timestamp_from_log_line_when_missing_date():
    line = 'this is a fake invalid syslog message'
    assert not logs.extract_utc_timestamp_from_log_line(line)
コード例 #6
0
ファイル: test_cmds_logs.py プロジェクト: georgekola/paasta
def test_extract_utc_timestamp_from_log_line_ok():
    fake_timestamp = '2015-07-22T10:38:46-07:00'
    fake_utc_timestamp = isodate.parse_datetime('2015-07-22T17:38:46.000000')

    line = '%s this is a fake syslog test message' % fake_timestamp
    assert logs.extract_utc_timestamp_from_log_line(line) == fake_utc_timestamp