'Helper function to test many values at once
Test the accuracy of evaluator\'s use of the function given by fname
Specifically, the equality of `fname(ins[i])` against outs[i].
This is used later to test a whole bunch of f(x) = y at a time'

def assert_function_values(self, fname, ins, outs, tolerance=0.001):

    for (arg, val) in zip(ins, outs):
        input_str = '{0}({1})'.format(fname, arg)
        result = calc.evaluator({}, {}, input_str)
        fail_msg = "Failed    on    function    {0}:    '{1}'    was    not    {2}".format(fname, input_str, val)
        self.assertAlmostEqual(val, result, delta=tolerance, msg=fail_msg)
