Skip to content

Commit

Permalink
Add test for Polygon (#24)
Browse files Browse the repository at this point in the history
* Add test for Polygon

Co-authored-by: Parth Tripathi <[email protected]>

* style: pre-commit fixes

Co-authored-by: Saransh <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 29, 2022
1 parent e5995c5 commit 7babe5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

0 comments on commit 7babe5c

Please sign in to comment.