Add mock for get_blacklist

Change-Id: I53a95911e47710db207721b6d6e5c556a33b0249
Closes-Bug: #1863636
This commit is contained in:
Chris MacNaughton 2020-02-17 17:28:28 +01:00
parent ae298fc547
commit 01cb6acc48
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ with patch('charmhelpers.contrib.hardening.harden.harden') as mock_dec:
TO_PATCH = [
'config',
'is_block_device',
'get_blacklist',
]
@ -51,6 +52,7 @@ class GetDevicesTestCase(test_utils.CharmTestCase):
os.path.join(self.tmp_dir, "device"): True,
}
self.is_block_device.side_effect = lambda x: self.bd.get(x, False)
self.get_blacklist.return_value = []
self.addCleanup(shutil.rmtree, self.tmp_dir)
def test_get_devices_empty(self):