add broken-log and iter-clients-test

This commit is contained in:
Thor77 2015-08-28 13:47:03 +02:00
parent 3efe4c09f0
commit 09ef24667d
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,2 @@
2015-05-18 16:00:14.951191|INFO |VirtualServerBase| 3| client disconnected 'Client1'(id:1) reason 'reasonmsg=ByeBye!'
2015-05-18 15:55:23.456679|INFO |VirtualServerBase| 3| client connected 'Client1'(id:1) from 1.2.3.4:1234

View File

@ -59,3 +59,14 @@ def test_debug_log():
clients = parse_logs('tests/res/test.log', file_log=True)
open('debug.txt')
remove('debug.txt')
@raises(exceptions.InvalidLog)
def test_parse_broken():
clients = parse_logs('tests/res/test.log.broken')
def test_iter_clients():
clients_length = len(clients.clients_by_id) + len(clients.clients_by_uid)
clients_iter = [client for client in clients]
assert len(clients_iter) == clients_length