'Ensure that various exceptions are correctly transformed.
Handle the myriad exceptions that could be raised from the
\'disassociate_and_release_floating_ip\' call.'

def _test_floatingip_delete_error_disassociate(self, raised_exc, expected_exc):

    req = fakes.HTTPRequest.blank('')
    with mock.patch.object(self.controller.network_api, 'get_floating_ip', return_value={'address': 'foo'}):
        with mock.patch.object(self.controller.network_api, 'get_instance_id_by_floating_address', return_value=None):
            with mock.patch.object(self.controller.network_api, 'disassociate_and_release_floating_ip', side_effect=raised_exc):
                self.assertRaises(expected_exc, self.controller.delete, req, 1)
