Skip to content

Commit

Permalink
Mock mount cache while running action tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwlehman committed Jul 20, 2015
1 parent e77416e commit 76efcf0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/storagetestcase.py
Expand Up @@ -68,6 +68,9 @@ def partition_probe(device):
self.partition_probe = PartitionDevice.probe
PartitionDevice.probe = partition_probe

self.get_active_mounts = blivet.formats.fs.mountsCache._getActiveMounts
blivet.formats.fs.mountsCache._getActiveMounts = Mock()

def tearDown(self):
blivet.devices.StorageDevice.status = self.storage_status
blivet.devices.DMDevice.status = self.dm_status
Expand All @@ -83,6 +86,8 @@ def tearDown(self):

blivet.devices.PartitionDevice.probe = self.partition_probe

blivet.formats.fs.mountsCache._getActiveMounts = self.get_active_mounts

def newDevice(self, *args, **kwargs):
""" Return a new Device instance suitable for testing. """
device_class = kwargs.pop("device_class")
Expand Down

0 comments on commit 76efcf0

Please sign in to comment.