From bf0966bfcf269a017919ece46a0d11a33c4f81c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 21 May 2016 03:46:17 +0200 Subject: [PATCH] tests: fix get_label mockup to return meaningful values Reject invalid argument. --- qubes/tests/vm/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qubes/tests/vm/__init__.py b/qubes/tests/vm/__init__.py index 2cba7960..69c98d82 100644 --- a/qubes/tests/vm/__init__.py +++ b/qubes/tests/vm/__init__.py @@ -46,7 +46,12 @@ class TestApp(qubes.tests.TestEmitter): def get_label(self, label): # pylint: disable=unused-argument - return self.labels[1] + if label in self.labels: + return self.labels[label] + for l in self.labels.values(): + if l.name == label: + return l + raise KeyError(label) def __init__(self): super(TestApp, self).__init__()