def test_equally_split_points(self): a = Point(0, 0) b = Point(0, 10) vector = Vector(a, b) points = vector.get_split_points(3) self.assertEqual(points, [a, Point(0, 5), b])
def test_proportions_split_points(self): a = Point(0, 0) b = Point(0, 10) vector = Vector(a, b) points = vector.get_split_points(3, [0, 0.4, 1]) self.assertEqual(points, [a, Point(0, 4), b])
def test_equally_split_points_with_division_by_0(self): a = Point(0, 0) b = Point(0, 10) vector = Vector(a, b) with self.assertRaises(ValueError): vector.get_split_points(1)
def test_equally_split_points_with_less_than_2_points(self): a = Point(0, 0) b = Point(0, 10) vector = Vector(a, b) with self.assertRaises(ValueError): vector.get_split_points(0)