Add test for Client.nick-property

This commit is contained in:
Thor77 2017-07-24 14:42:42 +02:00
parent 3acf282470
commit 7077446627
1 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,18 @@ def test_client_repr(clients):
assert str(clients['UID2']) == '<UID2, None>'
def test_client_nick(clients):
_, cl1, _, _, _ = clients
assert cl1.nick is None
assert not cl1.nick_history
cl1.nick = 'Client1'
assert cl1.nick == 'Client1'
assert None not in cl1.nick_history
cl1.nick = 'NewClient1'
assert cl1.nick == 'NewClient1'
assert 'Client1' in cl1.nick_history
def test_clients_iter(clients):
clients, cl1, cl2, uidcl1, uidcl2 = clients
client_list = list(iter(clients))