'Tests that instance_get_all_by_host fails with HostMappingNotFound.'

def test_servers_not_mapped(self):

    req = self._get_request(use_admin_context=True, url='/os-hypervisors?with_servers=1')
    with mock.patch.object(self.controller.host_api, 'instance_get_all_by_host', side_effect=exception.HostMappingNotFound(name='something')):
        result = self.controller.index(req)
        self.assertEqual(dict(hypervisors=[]), result)
