@mock.patch.object(report.SchedulerReportClient, 'get_usages_counts_for_limits')
@mock.patch.object(objects.InstanceMappingList, 'get_counts')
@mock.patch.object(quota, 'is_qfd_populated')
def test_get_legacy_counts(self, mock_qfd, mock_counts, mock_placement):
    mock_qfd.return_value = True
    mock_counts.return_value = {'project': {'instances': 1}}
    mock_placement.return_value = {'VCPU': 2, 'CUSTOM_BAREMETAL': 2, 'MEMORY_MB': 3}
    counts = placement_limits.get_legacy_counts('context', uuids.project_id)
    self.assertEqual(self.legacy, counts)
@mock.patch.object(report.SchedulerReportClient, 'get_usages_counts_for_limits')
@mock.patch.object(objects.InstanceMappingList, 'get_counts')
@mock.patch.object(quota, 'is_qfd_populated')
def test_get_legacy_counts(self, mock_qfd, mock_counts, mock_placement):
    mock_qfd.return_value = True
    mock_counts.return_value = {'project': {'instances': 1}}
    mock_placement.return_value = {'VCPU': 2, 'CUSTOM_BAREMETAL': 2, 'MEMORY_MB': 3}
    counts = placement_limits.get_legacy_counts('context', uuids.project_id)
    self.assertEqual(self.legacy, counts)