From 93b2278f6205889a2c85c2f61096be0734eeb97c Mon Sep 17 00:00:00 2001 From: melanie witt Date: Wed, 17 Dec 2014 00:15:01 +0000 Subject: [PATCH] initialize objects with context in InstanceFault object tests These changes aim to clean up the pattern of passing a context in object member functions create/destroy/refresh/save and instead initialize the object with the context when it's constructed. Related to blueprint kilo-objects Change-Id: Ia6be84d85e1e2a394a88c8f16d92af8dc90d7c4e --- nova/tests/unit/objects/test_instance_fault.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/unit/objects/test_instance_fault.py b/nova/tests/unit/objects/test_instance_fault.py index 97716d42d3..f31eedbdbd 100644 --- a/nova/tests/unit/objects/test_instance_fault.py +++ b/nova/tests/unit/objects/test_instance_fault.py @@ -77,13 +77,13 @@ class _TestInstanceFault(object): @mock.patch('nova.db.instance_fault_create') def _test_create(self, update_cells, mock_create, cells_fault_create): mock_create.return_value = fake_faults['fake-uuid'][1] - fault = instance_fault.InstanceFault() + fault = instance_fault.InstanceFault(context=self.context) fault.instance_uuid = 'fake-uuid' fault.code = 456 fault.message = 'foo' fault.details = 'you screwed up' fault.host = 'myhost' - fault.create(self.context) + fault.create() self.assertEqual(2, fault.id) mock_create.assert_called_once_with(self.context, {'instance_uuid': 'fake-uuid',