From 814bb16dfe198d048acc7a69dba8b68ebfd01685 Mon Sep 17 00:00:00 2001 From: melanie witt Date: Wed, 17 Dec 2014 00:13:17 +0000 Subject: [PATCH] initialize objects with context in FixedIP 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: I60be29ba0c6ccbadd4c4d9a2d5426d1047c01a82 --- nova/tests/unit/objects/test_fixed_ip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/unit/objects/test_fixed_ip.py b/nova/tests/unit/objects/test_fixed_ip.py index 116827416db9..14a27ee006a7 100644 --- a/nova/tests/unit/objects/test_fixed_ip.py +++ b/nova/tests/unit/objects/test_fixed_ip.py @@ -200,8 +200,8 @@ class _TestFixedIPObject(object): @mock.patch('nova.db.fixed_ip_create') def test_create(self, create): create.return_value = fake_fixed_ip - fixedip = fixed_ip.FixedIP(address='1.2.3.4') - fixedip.create(self.context) + fixedip = fixed_ip.FixedIP(context=self.context, address='1.2.3.4') + fixedip.create() create.assert_called_once_with( self.context, {'address': '1.2.3.4'}) self._compare(fixedip, fake_fixed_ip)