Test disconnect on server-stop

This commit is contained in:
Thor77 2017-02-23 21:49:39 +01:00
parent 962fd486af
commit 2753f548fe
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,4 @@
2015-05-18 15:00:00.000000|INFO |VirtualServer| 1| listening on 0.0.0.0:9987
2015-05-18 15:30:00.000000|INFO |VirtualServerBase| 3| client connected 'Client1'(id:1) from 1.2.3.4:1234
2015-05-18 15:40:00.000000|INFO |VirtualServerBase| 3| client connected 'Client2'(id:2) from 5.6.7.8:5678
2015-05-18 15:50:00.000000|INFO |VirtualServerBase| 1| stopped

View File

@ -96,3 +96,9 @@ def test_parse_utf8():
servers = parse_logs(testlog_path + '.utf8')
render_servers(servers, output_path)
remove(output_path)
def test_server_stop():
clients = _parse_details('tsstats/tests/res/test.log.stopped')
assert clients['1'].onlinetime.seconds / 60 == 20 # minutes
assert clients['2'].onlinetime.seconds / 60 == 10 # minutes