@mock.patch.object(host_manager.SolverSchedulerHostManager,
                        '_init_instance_info')
    @mock.patch.object(host_manager.SolverSchedulerHostManager,
                        '_init_aggregates')
    @mock.patch('nova.objects.ServiceList.get_by_binary',
                return_value=fakes.SERVICES)
    @mock.patch('nova.objects.InstanceList.get_by_host')
    @mock.patch('nova.objects.ComputeNodeList.get_all',
                return_value=fakes.COMPUTE_NODES_OBJ)
    @mock.patch('nova.db.instance_extra_get_by_instance_uuid',
                return_value={'numa_topology': None,
                              'pci_requests': None})
    def test_schedule_happy_day(self, mock_get_extra, mock_get_all,
                                mock_by_host, mock_get_by_binary,
                                mock_init_agg, mock_init_inst):
        self.flags(scheduler_host_manager='nova_solverscheduler.scheduler.'
                'solver_scheduler_host_manager.SolverSchedulerHostManager')
        self.flags(scheduler_solver_constraints=[], group='solver_scheduler')

        sched = fakes.FakeSolverScheduler()
        fake_context = context.RequestContext('user', 'project',
                is_admin=True)

        self.stubs.Set(sched.host_manager,
                       'get_hosts_stripping_ignored_and_forced',
                fake_get_hosts_stripping_ignored_and_forced)

        request_spec = {'num_instances': 10,
                        'instance_type': {'memory_mb': 512, 'root_gb': 512,
                                          'ephemeral_gb': 0,
                                          'vcpus': 1},
                        'instance_properties': {'project_id': 1,
                                                'root_gb': 512,
                                                'memory_mb': 512,
                                                'ephemeral_gb': 0,
                                                'vcpus': 1,
                                                'os_type': 'Linux'}}

        selected_hosts = sched._schedule(fake_context, request_spec, {})
        self.assertEqual(10, len(selected_hosts))
        for host in selected_hosts:
            self.assertTrue(host is not None)
setup parameters related to Elastic model
dataset/ETHPy150Open openstack/nova-solver-scheduler/nova_solverscheduler/tests/scheduler/test_solver_scheduler.py/SolverSchedulerTestCase.test_schedule_happy_day--crossover with--dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/fitting/xrf_model.py/ModelSpectrum.setup_elastic_model