From eafc98f54803bb53e3e1470cf9f0871dfe5bb351 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Wed, 22 Jun 2016 20:40:55 +0200 Subject: [PATCH] add test for tsstats.log.parse_logs --- tsstats/tests/test_log.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tsstats/tests/test_log.py b/tsstats/tests/test_log.py index 328c033..1dc1689 100644 --- a/tsstats/tests/test_log.py +++ b/tsstats/tests/test_log.py @@ -4,7 +4,7 @@ from time import sleep import pytest from tsstats.exceptions import InvalidLog -from tsstats.log import TimedLog, _bundle_logs, _parse_details +from tsstats.log import TimedLog, _bundle_logs, _parse_details, parse_logs testlog_path = 'tsstats/tests/res/test.log' @@ -77,3 +77,8 @@ def test_log_client_online(): sleep(2) clients = _parse_details(testlog_path) assert int(clients['1'].onlinetime.total_seconds()) == old_onlinetime + 2 + + +def test_parse_logs(): + assert len(_parse_details(testlog_path)) ==\ + len(parse_logs(testlog_path)[''])