'Tests that when _schedule() calls _claim_resources(), that we
appropriately call the placement client to claim resources for the
instance.'

def test_claim_resources(self):

    ctx = mock.Mock(user_id=uuids.user_id)
    spec_obj = mock.Mock(project_id=uuids.project_id)
    instance_uuid = uuids.instance
    alloc_reqs = [mock.sentinel.alloc_req]
    res = self.driver._claim_resources(ctx, spec_obj, instance_uuid, alloc_reqs)
    pc = self.placement_client
    pc.claim_resources.return_value = True
    pc.claim_resources.assert_called_once_with(uuids.instance, mock.sentinel.alloc_req, uuids.project_id, uuids.user_id)
    self.assertTrue(res)
