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
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 melanie witt
					melanie witt