def test_vif_instance_not_found(self):
        self.mox.StubOutWithMock(compute_api.API, 'get')
        fake_context = context.RequestContext('fake', 'fake')
        fake_req = FakeRequest(fake_context)

        compute_api.API.get(
            fake_context, 'fake_uuid', expected_attrs=None,
            want_objects=False).AndRaise(
                exception.InstanceNotFound(instance_id='instance-0000'))

        self.mox.ReplayAll()
        self.assertRaises(
            webob.exc.HTTPNotFound,
            virtual_interfaces.ServerVirtualInterfaceController().index,
            fake_req, 'fake_uuid')
Beispiel #2
0
 def _set_controller(self):
     self.controller = vi20.ServerVirtualInterfaceController()
Beispiel #3
0
 def setUp(self):
     super(ServerVirtualInterfaceTest, self).setUp()
     self.controller = virtual_interfaces.ServerVirtualInterfaceController()
     self.stubs.Set(network.api.API, "get_vifs_by_instance",
                    get_vifs_by_instance)