Merge "Tests: mock psutil usage in quobyte tests"

This commit is contained in:
Jenkins 2017-04-13 20:14:33 +00:00 committed by Gerrit Code Review
commit 4007618092
1 changed files with 3 additions and 1 deletions

View File

@ -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."