mirror of
https://github.com/Thor77/TeamspeakStats.git
synced 2025-07-07 07:58:43 -04:00
add testcase for #1
This commit is contained in:
parent
20cac026d5
commit
3972594787
1 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tsstats.exceptions import InvalidLog
|
from tsstats.exceptions import InvalidLog
|
||||||
|
@ -42,3 +44,12 @@ def test_log_invalid():
|
||||||
def test_log_multiple():
|
def test_log_multiple():
|
||||||
assert len(parse_log('tsstats/tests/res/test.log')) == \
|
assert len(parse_log('tsstats/tests/res/test.log')) == \
|
||||||
len(parse_logs('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
|
||||||
|
|
Loading…
Add table
Reference in a new issue