diff --git a/oca/tests/test_virtualmachine.py b/oca/tests/test_virtualmachine.py index ae1a056..eda2bce 100644 --- a/oca/tests/test_virtualmachine.py +++ b/oca/tests/test_virtualmachine.py @@ -102,7 +102,7 @@ def test_actions(self): oca.client = oca.Client('test:test') vm = oca.VirtualMachine(self.xml, self.client) for action in ['shutdown', 'hold', 'release', 'stop', 'cancel', - 'suspend', 'resume', 'restart', 'finalize']: + 'suspend', 'resume', 'restart', 'finalize', 'delete']: self.client.call = Mock(return_value='') getattr(vm, action)() self.client.call.assert_called_once_with('vm.action', action, '6') @@ -150,3 +150,6 @@ def test_user_template_variables(self): vm._convert_types() greeting = vm.user_template.greeting assert greeting == "Hello World" + + def test_update(self): + pass diff --git a/oca/vm.py b/oca/vm.py index a7db753..53c8cbf 100644 --- a/oca/vm.py +++ b/oca/vm.py @@ -227,6 +227,12 @@ def resubmit(self): ''' self._action('resubmit') + def delete(self): + ''' + Delete the VM. + ''' + self._action('delete') + def _action(self, action): self.client.call(self.METHODS['action'], action, self.id)