'Negative tests.'

@mock.patch('pypowervm.tasks.power.power_off', autospec=True)
@mock.patch('nova.virt.powervm.vm.get_instance_wrapper')
def test_power_off_negative(self, mock_wrap, mock_power_off):

    mock_wrap.return_value = mock.Mock(state=pvm_bp.LPARState.RUNNING)
    mock_power_off.side_effect = pvm_exc.VMPowerOffFailure(reason='Something    bad.', lpar_nm='TheLPAR')
    self.assertRaises(exception.InstancePowerOffFailure, vm.power_off, None, self.inst)
    mock_power_off.side_effect = ValueError()
    self.assertRaises(ValueError, vm.power_off, None, self.inst)
