Tests: mock psutil usage in quobyte tests
Currently, psutil is called here, and the results
depend on the state of the system instead of fixed
mock values.
Closes-Bug:
@@ -970,7 +970,9 @@ class QuobyteDriverTestCase(test.TestCase):
stat_mock.assert_called_once_with(self.TEST_MNT_POINT)
part_mock.assert_called_once_with(all=True)
- def test_validate_volume_no_mtab_entry(self):
+ @mock.patch.object(psutil, "disk_partitions")
+ def test_validate_volume_no_mtab_entry(self, part_mock):
+ part_mock.return_value = [] # no quobyte@ devices
msg = ("Volume driver reported an error: "
"No matching Quobyte mount entry for %(mpt)s"
" could be found for validation in partition list."
