add broken-log and iter-clients-test
This commit is contained in:
parent
3efe4c09f0
commit
09ef24667d
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue