def testInterface(algo):
    """ Tests whether the algorithm is properly implementing the
    correct Blackbox-optimization interface."""
    # without any arguments, initialization has to work
    emptyalgo = algo()
    try:
        # but not learning
        emptyalgo.learn(0)
        return "Failed to throw missing evaluator error?"
    except __HOLE__:
        pass

    emptyalgo.setEvaluator(sf, xa1)
    # not it can run
    emptyalgo.learn(0)

    # simple functions don't check for dimension mismatch
    algo(sf, xa1)
    algo(sf, xa100)

    # for these, either an initial point or a dimension parameter is required
    algo(sf, numParameters=2)

    try:
        algo(sf)
        return "Failed to throw unknown dimension error"
    except ValueError:
        pass

    # FitnessEvaluators do not require that
    algo(ife1)

    # parameter containers can be used too
    algo(ife2, pc2)

    return True
dataset/ETHPy150Open pybrain/pybrain/pybrain/tests/optimizationtest.py/testInterface