From 77fb3128a95ea7b370d275b7ce7b902cd53f13ef Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 25 Sep 2017 23:23:26 +0200 Subject: [PATCH] Add Client.__eq__ required for cache-tests --- tsstats/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tsstats/client.py b/tsstats/client.py index 32661d9..38f56e1 100644 --- a/tsstats/client.py +++ b/tsstats/client.py @@ -171,3 +171,17 @@ class Client(object): def __repr__(self): return self.__str__() + + def __eq__(self, other): + if type(other) != Client: + raise NotImplemented + return self.identifier == other.identifier \ + and self.nick == other.nick \ + and self.nick_history == other.nick_history \ + and self.connected == other.connected \ + and self.onlinetime == other.onlinetime \ + and self.kicks == other.kicks \ + and self.pkicks == other.pkicks \ + and self.bans == other.bans \ + and self.pbans == other.pbans \ + and self.last_seen == other.last_seen