'Tests the show() result when servers are included in the output.'

def test_show_with_servers(self):

    instances = objects.InstanceList(objects=[objects.Instance(id=1, uuid=uuids.hyper1_instance1)])
    hyper_id = self._get_hyper_id()
    req = self._get_request(use_admin_context=True, url=('/os-hypervisors/%s?with_servers=on' % hyper_id))
    with mock.patch.object(self.controller.host_api, 'instance_get_all_by_host', return_value=instances) as mock_inst_get_all:
        result = self.controller.show(req, hyper_id)
    show_with_servers = copy.deepcopy(self.DETAIL_HYPERS_DICTS[0])
    show_with_servers['servers'] = [{'name': 'instance-00000001', 'uuid': uuids.hyper1_instance1}]
    self.assertDictEqual(dict(hypervisor=show_with_servers), result)
    mock_inst_get_all.assert_called_once_with(req.environ['nova.context'], TEST_HYPERS_OBJ[0].host)
