'Tests GET /os-hypervisors?with_servers=1 when there are no
instances on the given host.'

def test_servers_with_no_server(self):

    with mock.patch.object(self.controller.host_api, 'instance_get_all_by_host', return_value=[]) as mock_inst_get_all:
        req = self._get_request(use_admin_context=True, url='/os-hypervisors?with_servers=1')
        result = self.controller.index(req)
    self.assertEqual(dict(hypervisors=self.INDEX_HYPER_DICTS), result)
    self.assertEqual(2, mock_inst_get_all.call_count)
    mock_inst_get_all.assert_has_calls((mock.call(req.environ['nova.context'], TEST_HYPERS_OBJ[0].host), mock.call(req.environ['nova.context'], TEST_HYPERS_OBJ[1].host)))
