def testClosestValSingle(self): val = util.closest_val(1., np.array([50.])) assert val == 0
def testValueErrorOnEmptyList(self): util.closest_val(1., [])
def testValueErrorOnEmptyArray(self): util.closest_val(1., np.array([]))
def testClosestValBelowList(self): val = util.closest_val(-5., self.list) assert val == 0
def testClosestValAboveList(self): val = util.closest_val(20., self.list) assert val == 2
def testClosestValAbove(self): val = util.closest_val(20., self.array) assert val == 2
def testClosestValInternalNegative(self): val = util.closest_val(-3.5, -1 * self.array) assert val == 1
def testClosestValInternal(self): val = util.closest_val(3.5, self.array) assert val == 1
def testClosestValBelow(self): val = util.closest_val(-5., self.array) assert val == 0
def testClosestValInternalList(self): val = util.closest_val(3.5, self.list) assert val == 1
def testClosestValInternalNegative(self): val = util.closest_val(-3.5, -1*self.array) assert val == 1