def test_lvm_volume_group_exists_finds_no_volume_group(self, _check): volume_group = "test" def raise_error(x): raise subprocess.CalledProcessError(1, x) _check.side_effect = raise_error result = cinder_utils.lvm_volume_group_exists(volume_group) self.assertFalse(result) _check.assert_called_with(['vgdisplay', volume_group])
def test_lvm_volume_group_exists_finds_no_volume_group(self, _check): volume_group = "test" def raise_error(x): raise subprocess.CalledProcessError(1, x) _check.side_effect = raise_error result = cinder_utils.lvm_volume_group_exists(volume_group) self.assertFalse(result) _check.assert_called_with(['vgdisplay', volume_group])
def test_lvm_volume_group_exists_finds_volume_group(self, _check): volume_group = "test" _check.return_value = True result = cinder_utils.lvm_volume_group_exists(volume_group) self.assertTrue(result) _check.assert_called_with(['vgdisplay', volume_group])
def test_lvm_volume_group_exists_finds_volume_group(self, _check): volume_group = "test" _check.return_value = True result = cinder_utils.lvm_volume_group_exists(volume_group) self.assertTrue(result) _check.assert_called_with(['vgdisplay', volume_group])