def test_median_single_item_array(self): self._test(1, labmath.median([1]))
def test_median(self): self._test(2, labmath.median([1,2,3])) self._test(1, labmath.median([1,1.5,-1.5])) self._test(2.5, labmath.median([1, 2, 3, 4]))
def test_median_empty_array(self): self._test(0, labmath.median([]))