Beispiel #1
0
 def test_create(self, mock_action_start):
     mock_action_start.return_value = fake_action
     action = instance_action.InstanceAction(self.context)
     expected_updates = action.obj_get_changes()
     action.create()
     mock_action_start.assert_called_once_with(self.context,
                                               expected_updates)
     self.compare_obj(action, fake_action)
Beispiel #2
0
 def test_create_id_in_updates_error(self):
     action = instance_action.InstanceAction(self.context, id=1)
     ex = self.assertRaises(exception.ObjectActionError, action.create)
     self.assertIn('already created', six.text_type(ex))