def test_type_error(self, arr, bw): with self.assertRaises(SpatSegTypeError): triangle(arr, bw)
def test_value_error(self, arr, bw): with self.assertRaises(SpatSegValueError): triangle(arr, bw)
def test_min(self, arr, bw): is_positive = triangle(arr, bw) >= 0 self.assertEqual(is_positive.all(), True)
def test_max(self, arr, bw): less_than_1 = triangle(arr, bw) <= 1 self.assertEqual(less_than_1.all(), True)
def test_empty(self, arr, bw): npt.assert_array_equal(np.empty_like(arr), triangle(arr, bw))