From 7babe5cee2390a8c78489174abee28115612644b Mon Sep 17 00:00:00 2001 From: Parth Tripathi <86532127+parthxtripathi@users.noreply.github.com> Date: Thu, 29 Sep 2022 20:11:06 +0530 Subject: [PATCH] Add test for Polygon (#24) * Add test for Polygon Co-authored-by: Parth Tripathi * style: pre-commit fixes Co-authored-by: Saransh Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- tests/test_geometry.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_geometry.py b/tests/test_geometry.py index 9210691..492f232 100644 --- a/tests/test_geometry.py +++ b/tests/test_geometry.py @@ -51,3 +51,13 @@ def test_regularpolygon(): regularpolygon, (rp.geometry.RegularPolygon, manim.RegularPolygon) ) assert regularpolygon.n == 6 + + +def test_polygon(): + polygon = rp.geometry.Polygon([2, 4, 8], [1, 0, 0], [4, 4, 8]) + assert ( + polygon.__repr__() + == f"Polygon(vertices={[v for v in polygon.vertices]}) (alias for manim.Polygon)" + ) + assert isinstance(polygon, (rp.geometry.Polygon)) + assert polygon.vertices == ([2, 4, 8], [1, 0, 0], [4, 4, 8])