Module: check_mk
Branch: master
Commit: 90431c0644be64fee026079acdbab4546b661025
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90431c0644be64…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Fri Dec 7 09:34:03 2018 +0100
checktestlib: allow 'item not found'-case
Change-Id: I16c24ba1437829b8d1985a1a43bf63ef9d481344
---
tests/unit/checks/checktestlib.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/unit/checks/checktestlib.py b/tests/unit/checks/checktestlib.py
index e22049c..36282fd 100644
--- a/tests/unit/checks/checktestlib.py
+++ b/tests/unit/checks/checktestlib.py
@@ -173,11 +173,13 @@ class CheckResult(object):
If the result is already a plain check result in its tuple representation,
we initialize a list of length 1.
"""
+ self.subresults = []
+ if result is None:
+ return
if isinstance(result, CheckResult):
self.__dict__ = result.__dict__
return
- self.subresults = []
if isinstance(result, types.GeneratorType):
for subresult in result:
self.subresults.append(BasicCheckResult(*subresult))