'Tests that the select_destinations() method returns the list of
hosts from the _schedule() method when the number of returned hosts
equals the num_instances on the spec object'

@mock.patch('nova.scheduler.filter_scheduler.FilterScheduler._schedule')
def test_select_destinations_match_num_instances(self, mock_schedule):

    spec_obj = objects.RequestSpec(flavor=objects.Flavor(memory_mb=512, root_gb=512, ephemeral_gb=0, swap=0, vcpus=1), project_id=uuids.project_id, num_instances=1)
    mock_schedule.return_value = [mock.sentinel.hs1]
    dests = self.driver.select_destinations(self.context, spec_obj, mock.sentinel.instance_uuids, mock.sentinel.alloc_reqs_by_rp_uuid, mock.sentinel.p_sums)
    mock_schedule.assert_called_once_with(self.context, spec_obj, mock.sentinel.instance_uuids, mock.sentinel.alloc_reqs_by_rp_uuid, mock.sentinel.p_sums)
    self.assertEqual([mock.sentinel.hs1], dests)
