From 7077446627c4b56f7a096fc241331cc78dae34bf Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 24 Jul 2017 14:42:42 +0200 Subject: [PATCH] Add test for Client.nick-property --- tsstats/tests/test_client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tsstats/tests/test_client.py b/tsstats/tests/test_client.py index 2f28661..7ebdb25 100644 --- a/tsstats/tests/test_client.py +++ b/tsstats/tests/test_client.py @@ -36,6 +36,18 @@ def test_client_repr(clients): assert str(clients['UID2']) == '' +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))