Nexenta unit tests: add mock for _read_mounts call

We don't need to read anything from /proc/mounts from the unit tests.

Change-Id: I86c21a8b816ad13c03dcd225e113b739155724a2
This commit is contained in:
Ivan Kolodyazhny 2020-04-24 14:17:06 +03:00
parent 595b8adc44
commit ce5eff3347
1 changed files with 4 additions and 1 deletions

View File

@ -616,7 +616,9 @@ class TestNexentaNfsDriver(test.TestCase):
self.nms_mock.snapshot.destroy.assert_called_with(
'stack/share/volume-1@snapshot1', '')
def test_delete_volume(self):
@mock.patch('os_brick.remotefs.remotefs.'
'RemoteFsClient._read_mounts')
def test_delete_volume(self, list_mount_points):
self.drv.share2nms = {self.TEST_EXPORT1: self.nms_mock}
self._create_volume_db_entry()
@ -633,6 +635,7 @@ class TestNexentaNfsDriver(test.TestCase):
})
self.nms_mock.folder.destroy.assert_called_with(
'stack/share/volume-1', '-r')
list_mount_points.assert_called_once()
# Check that exception not raised if folder does not exist on
# NexentaStor appliance.