From 4b865eda64f0a3a9f6cba0f9aaa6f82915c52680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 9 Sep 2021 12:46:56 +0200 Subject: [PATCH] Improve TestVM and TestVMCollection capabilities Added an is_network method to TestVM and get_blind to TestVMCollection. --- qubesadmin/tests/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubesadmin/tests/__init__.py b/qubesadmin/tests/__init__.py index 996276f2..d8a10502 100644 --- a/qubesadmin/tests/__init__.py +++ b/qubesadmin/tests/__init__.py @@ -37,6 +37,9 @@ def __init__(self, name, **kwargs): def get_power_state(self): return getattr(self, 'power_state', 'Running') + def is_networked(self): + return bool(getattr(self, 'netvm', False)) + def __str__(self): return self.name @@ -50,6 +53,8 @@ class TestVMCollection(dict): def __iter__(self): return iter(self.values()) + get_blind = dict.get + class TestProcess(object): def __init__(self, input_callback=None, stdout=None, stderr=None, stdout_data=None):