Implemented Ellipse Tests

This commit is contained in:
Darren Eberly
2020-05-30 20:42:15 -04:00
parent f585fe920c
commit 5b9ddff6ee

View File

@@ -6,7 +6,77 @@ import pytest
from pytiled_parser import common_types, tiled_object
ELLIPSES = []
ELLIPSES = [
(
"""
{"ellipse":true,
"height":18.5517790155735,
"id":6,
"name":"name: ellipse",
"rotation":0,
"type":"ellipse",
"visible":true,
"width":57.4013868364215,
"x":37.5400704785722,
"y":81.1913152210981}
""",
tiled_object.Ellipse(
id_=6,
size=common_types.Size(57.4013868364215, 18.5517790155735),
name="name: ellipse",
rotation=0,
type="ellipse",
visible=True,
coordinates=common_types.OrderedPair(37.5400704785722, 81.1913152210981),
),
),
(
"""
{"ellipse":true,
"height":31.4288962146186,
"id":7,
"name":"name: ellipse - invisible",
"rotation":0,
"type":"ellipse",
"visible":false,
"width":6.32943048766625,
"x":22.6986472661134,
"y":53.9092872570194}
""",
tiled_object.Ellipse(
id_=7,
size=common_types.Size(6.32943048766625, 31.4288962146186),
name="name: ellipse - invisible",
rotation=0,
type="ellipse",
visible=True,
coordinates=common_types.OrderedPair(22.6986472661134, 53.9092872570194),
),
),
(
"""
{"ellipse":true,
"height":24.2264408321018,
"id":8,
"name":"name: ellipse - rotated",
"rotation":111,
"type":"ellipse",
"visible":true,
"width":29.6828464249176,
"x":35.7940206888712,
"y":120.040923041946}
""",
tiled_object.Ellipse(
id_=8,
size=common_types.Size(29.6828464249176, 24.2264408321018),
name="name: ellipse - rotated",
rotation=111,
type="ellipse",
visible=True,
coordinates=common_types.OrderedPair(35.7940206888712, 120.040923041946),
),
),
]
RECTANGLES = [
(
@@ -23,7 +93,7 @@ RECTANGLES = [
""",
tiled_object.Rectangle(
id_=1,
size=common_types.Size(41.4686825053996, 45.3972945322269),
size=common_types.Size(45.3972945322269, 41.4686825053996),
name="name: rectangle",
rotation=0,
type="rectangle",