Module: check_mk
Branch: master
Commit: 73688454b62977be67ca9ea2ff86beead488630b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73688454b62977…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Feb 15 13:26:42 2018 +0100
checktestlib: Add __repr__ methods to DiscoveryEntry and DiscoveryResult
Change-Id: I62703cb1aab9fd81bc05a471253bc4370ce7996e
---
tests/checks/checktestlib.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/checks/checktestlib.py b/tests/checks/checktestlib.py
index dbabbcc..80626e4 100644
--- a/tests/checks/checktestlib.py
+++ b/tests/checks/checktestlib.py
@@ -148,6 +148,9 @@ class DiscoveryEntry(Tuploid):
def tuple(self):
return (self.item, self.default_params)
+ def __repr__(self):
+ return "DiscoveryEntry(%r, %r)" % (self.item, self.default_params)
+
class DiscoveryResult(object):
"""
@@ -167,3 +170,6 @@ class DiscoveryResult(object):
def __eq__(self, other_value):
return all(entry in other_value for entry in self.entries) and \
all(other_entry in self.entries for other_entry in other_value)
+
+ def __repr__(self):
+ return "DiscoveryResult(%s)" % (",\n".join([repr(entry) for
entry in self.entries]))