Skip to content

Commit

Permalink
Improve TestVM and TestVMCollection capabilities
Browse files Browse the repository at this point in the history
Added an is_network method to TestVM and get_blind
to TestVMCollection.
  • Loading branch information
marmarta committed Sep 9, 2021
1 parent 3f8200e commit 4b865ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qubesadmin/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down

0 comments on commit 4b865ed

Please sign in to comment.