def METHOD_NAME(n):
    """
    Create a deferred and adds a trivial callback/errback/both to it the given
    number of times, and then shoots a result through all of the callbacks.
    """
    d = defer.Deferred()
    def f(result):
        return result
    for i in range(n):
        d.addCallback(f)
        d.addErrback(f)
        d.addBoth(f)
        d.addCallbacks(f)
    d.callback(1)