From 3972594787f4ed33d656ff0c097fdb3633a96b14 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 12 Jun 2016 16:38:28 +0200 Subject: [PATCH] add testcase for #1 --- tsstats/tests/test_log.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tsstats/tests/test_log.py b/tsstats/tests/test_log.py index 21f2774..4cd30eb 100644 --- a/tsstats/tests/test_log.py +++ b/tsstats/tests/test_log.py @@ -1,3 +1,5 @@ +from time import sleep + import pytest from tsstats.exceptions import InvalidLog @@ -42,3 +44,12 @@ def test_log_invalid(): def test_log_multiple(): assert len(parse_log('tsstats/tests/res/test.log')) == \ len(parse_logs('tsstats/tests/res/test.log')) + + +@pytest.mark.slowtest +def test_log_client_online(): + clients = parse_log('tsstats/tests/res/test.log') + assert clients['1'].onlinetime == 402 + sleep(2) + clients = parse_log('tsstats/tests/res/test.log') + assert clients['1'].onlinetime == 404