def METHOD_NAME(self, operation):
    self.ops.append(operation)
    response = self.responses.pop(0)
    if isinstance(response, SortingHatClientError):
        raise response
    else:
        return response