Add test for invalid log line

This commit is contained in:
Thor77 2017-09-14 22:37:56 +02:00
parent b9f798d04d
commit 52f5cc3ac1
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import pendulum import pendulum
import pytest import pytest
from tsstats.log import TimedLog, _bundle_logs, parse_logs from tsstats.log import TimedLog, _bundle_logs, _parse_line, parse_logs
from tsstats.template import render_servers from tsstats.template import render_servers
testlog_path = 'tsstats/tests/res/test.log' testlog_path = 'tsstats/tests/res/test.log'
@ -93,3 +93,7 @@ def test_parse_groups():
def test_parse_utf8(output): def test_parse_utf8(output):
servers = parse_logs(testlog_path + '.utf8') servers = parse_logs(testlog_path + '.utf8')
render_servers(servers, output) render_servers(servers, output)
def test_parse_invalid_line():
assert _parse_line('INVALID') == []