Module: check_mk
Branch: master
Commit: 9a53061a0a07c3c4914e0a376924fdfaa9826704
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a53061a0a07c3…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Jan 19 15:55:12 2018 +0100
checktestlib: Fix inheritance from Tuploid
Change-Id: I8c60c7fca75e87f97cad184eb9346bb59f4fbb42
---
tests/checks/checktestlib.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/checks/checktestlib.py b/tests/checks/checktestlib.py
index 6ab4f8d..097f25e 100644
--- a/tests/checks/checktestlib.py
+++ b/tests/checks/checktestlib.py
@@ -5,7 +5,7 @@ class Tuploid(object):
def __eq__(self, other_value):
if isinstance(other_value, self.__class__):
- return all(x==y for x, y in zip(other_value.tuple, self.tuple))
+ return other_value.tuple == self.tuple
elif type(other_value) == tuple:
return all(x==y for x, y in zip(other_value, self.tuple))
@@ -14,7 +14,7 @@ class Tuploid(object):
@property
def tuple(self):
- return (self.key, self.value, self.warn, self.crit, self.minimum, self.maximum)
+ raise NotImplementedError()
class PerfValue(Tuploid):
@@ -44,6 +44,10 @@ class PerfValue(Tuploid):
assert type(maximum) in [int, float, types.NoneType]
self.maximum = maximum
+ @property
+ def tuple(self):
+ return (self.key, self.value, self.warn, self.crit, self.minimum, self.maximum)
+
class BasicCheckResult(Tuploid):
"""
@@ -72,6 +76,10 @@ class BasicCheckResult(Tuploid):
else:
self.perfdata = None
+ @property
+ def tuple(self):
+ return (self.status, self.infotext, self.perfdata)
+
class CheckResult(object):
"""