def local_error_test(self): orgValues = [11, 33.1, 2.3, 6.54, 123.1, 12.54, 12.9] calValues = [24, 1.23, 342, 1.21, 4.112, 9.543, 3.54] gmape = GeometricMeanAbsolutePercentageError() for idx in xrange(len(orgValues)): res = ((math.fabs(calValues[idx] - orgValues[idx]))/orgValues[idx])*100 assert str(res)[:6] == str(gmape.local_error([orgValues[idx]], [calValues[idx]]))[:6]