Skip to content

Commit

Permalink
Add coverage for boundings functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Dec 21, 2024
1 parent 74f2c34 commit 1b862f3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/formats/test_collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,18 @@ def test_modifying_collision(surface_bmscc: Bmscc):
point = surface_bmscc.get_point(2, 9)
assert point["x"] == -800.0
assert point["y"] == -7000.0


def test_get_boundings(surface_bmscc: Bmscc):
total_boundings = surface_bmscc.get_total_boundings()
polys = surface_bmscc.get_data().polys
for poly in polys:
poly_boundings = surface_bmscc.get_poly_boundings(poly)
# x1
assert poly_boundings[0] >= total_boundings[0]
# y1
assert poly_boundings[1] >= total_boundings[1]
# x2
assert poly_boundings[2] <= total_boundings[2]
# y2
assert poly_boundings[3] <= total_boundings[3]

0 comments on commit 1b862f3

Please sign in to comment.