'Test that when the placement API returns a list of aggregate UUIDs,
that we cache that aggregate information in the appropriate map.'

def test_get_provider_aggregates_found(self):

    uuid = uuids.compute_node
    resp_mock = mock.Mock(status_code=200)
    json_data = {'aggregates': [uuids.agg1, uuids.agg2]}
    resp_mock.json.return_value = json_data
    self.ks_sess_mock.get.return_value = resp_mock
    result = self.client._get_provider_aggregates(uuid)
    expected = set([uuids.agg1, uuids.agg2])
    expected_url = (('/resource_providers/' + uuid) + '/aggregates')
    self.ks_sess_mock.get.assert_called_once_with(expected_url, endpoint_filter=mock.ANY, raise_exc=False, headers={'OpenStack-API-Version': 'placement    1.1'})
    self.assertEqual(expected, result)
