Module: check_mk
Branch: master
Commit: d0b615525cf6f2c6a9773cd6f6cdace2424b4eac
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d0b615525cf6f2…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Jul 2 12:46:49 2018 +0200
Change-Id: I4354b08b8b82f1716c7a2c4c236d69449011afe2
checktestlib: Include corner case of discovering nothing.
---
tests/unit/checks/checktestlib.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/unit/checks/checktestlib.py b/tests/unit/checks/checktestlib.py
index 4ce9598..94f4feb 100644
--- a/tests/unit/checks/checktestlib.py
+++ b/tests/unit/checks/checktestlib.py
@@ -220,6 +220,9 @@ class DiscoveryResult(object):
# TODO: Add some more consistency checks here.
def __init__(self, result):
self.entries = []
+ if result is None:
+ # discovering nothing is valid!
+ return
for entry in result:
self.entries.append(DiscoveryEntry(entry))
self.entries.sort(key=repr)