diff options
author | Chris Behrens <cbehrens@codestud.com> | 2014-05-17 13:45:00 -0700 |
---|---|---|
committer | Chris Behrens <cbehrens@codestud.com> | 2014-06-24 00:49:07 -0700 |
commit | 49170d772e985ece78f0a63f971051bd08682307 (patch) | |
tree | 35b0721b7945c247aaeb9ccb8436b1f4a693d045 /nova/tests/network/test_manager.py | |
parent | e309bc4e5a3173f55dfc9f21f849bbc0e0908ee6 (diff) | |
download | nova-49170d772e985ece78f0a63f971051bd08682307.tar.gz |
Fix the rest of direct uses of instance module objects
This switches the remaining occurences of
nova.objects.instance.Instance* to nova.objects.Instance*.
Partial-Blueprint: object-subclassing
Change-Id: I3017c149cc9fbc6b1fbecb003dc55455b1dcd12c
Diffstat (limited to 'nova/tests/network/test_manager.py')
-rw-r--r-- | nova/tests/network/test_manager.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py index 0e513d8aec..ae1f60ea8a 100644 --- a/nova/tests/network/test_manager.py +++ b/nova/tests/network/test_manager.py @@ -32,9 +32,9 @@ from nova.network import floating_ips from nova.network import linux_net from nova.network import manager as network_manager from nova.network import model as net_model +from nova import objects from nova.objects import fixed_ip as fixed_ip_obj from nova.objects import floating_ip as floating_ip_obj -from nova.objects import instance as instance_obj from nova.objects import network as network_obj from nova.objects import quotas as quotas_obj from nova.objects import virtual_interface as vif_obj @@ -643,7 +643,7 @@ class FlatNetworkTestCase(test.TestCase): @mock.patch('nova.objects.quotas.ids_from_instance') def test_allocate_calculates_quota_auth(self, util_method, reserve, get_by_uuid): - inst = instance_obj.Instance() + inst = objects.Instance() inst['uuid'] = 'nosuch' get_by_uuid.return_value = inst reserve.side_effect = exception.OverQuota(overs='testing') @@ -658,7 +658,7 @@ class FlatNetworkTestCase(test.TestCase): @mock.patch('nova.objects.quotas.ids_from_instance') def test_deallocate_calculates_quota_auth(self, util_method, reserve, get_by_address): - inst = instance_obj.Instance(uuid='fake-uuid') + inst = objects.Instance(uuid='fake-uuid') fip = fixed_ip_obj.FixedIP(instance_uuid='fake-uuid', virtual_interface_id=1) get_by_address.return_value = fip @@ -675,7 +675,7 @@ class FlatNetworkTestCase(test.TestCase): def test_allocate_fixed_ip_passes_string_address(self, mock_associate, mock_get): mock_associate.side_effect = test.TestingException - instance = instance_obj.Instance(context=self.context) + instance = objects.Instance(context=self.context) instance.create() mock_get.return_value = instance self.assertRaises(test.TestingException, @@ -707,7 +707,7 @@ class FlatNetworkTestCase(test.TestCase): virtual_interface_id=1) mock_fixedip_associate.return_value = fip - instance = instance_obj.Instance(context=self.context) + instance = objects.Instance(context=self.context) instance.create() mock_instance_get.return_value = instance @@ -883,7 +883,7 @@ class VlanNetworkTestCase(test.TestCase): def test_allocate_fixed_ip_passes_string_address(self, mock_associate, mock_get): mock_associate.side_effect = test.TestingException - instance = instance_obj.Instance(context=self.context) + instance = objects.Instance(context=self.context) instance.create() mock_get.return_value = instance self.assertRaises(test.TestingException, @@ -901,7 +901,7 @@ class VlanNetworkTestCase(test.TestCase): def test_allocate_fixed_ip_passes_string_address_vpn(self, mock_associate, mock_get): mock_associate.side_effect = test.TestingException - instance = instance_obj.Instance(context=self.context) + instance = objects.Instance(context=self.context) instance.create() mock_get.return_value = instance self.assertRaises(test.TestingException, @@ -1807,8 +1807,8 @@ class CommonNetworkTestCase(test.TestCase): network_id=123)] manager.deallocate_for_instance( - ctx, instance=instance_obj.Instance._from_db_object(self.context, - instance_obj.Instance(), instance_get.return_value)) + ctx, instance=objects.Instance._from_db_object(self.context, + objects.Instance(), instance_get.return_value)) self.assertEqual([ (ctx, '1.2.3.4', 'fake-host') @@ -2411,7 +2411,7 @@ class AllocateTestCase(test.TestCase): db.floating_ip_create(self.context, {'address': address, 'pool': 'nova'}) - inst = instance_obj.Instance() + inst = objects.Instance() inst.host = self.compute.host inst.display_name = HOST inst.instance_type_id = 1 @@ -2614,7 +2614,7 @@ class FloatingIPTestCase(test.TestCase): def test_deallocation_deleted_instance(self): self.stubs.Set(self.network, '_teardown_network_on_host', lambda *args, **kwargs: None) - instance = instance_obj.Instance() + instance = objects.Instance() instance.project_id = self.project_id instance.deleted = True instance.create(self.context) @@ -2634,7 +2634,7 @@ class FloatingIPTestCase(test.TestCase): def test_deallocation_duplicate_floating_ip(self): self.stubs.Set(self.network, '_teardown_network_on_host', lambda *args, **kwargs: None) - instance = instance_obj.Instance() + instance = objects.Instance() instance.project_id = self.project_id instance.create(self.context) network = db.network_create_safe(self.context.elevated(), { |