Skip to content

Commit 3cbbe4e

Browse files
cppartsbmatthieu3
authored andcommitted
adding tests for rotation setting
1 parent cafdbd6 commit 3cbbe4e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

src/tests/test_aladin.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,44 @@ def test_aladin_angle_fov_set(angle: float) -> None:
129129
assert aladin.fov.deg == angle_fov.deg
130130

131131

132+
test_aladin_float_rotation = [
133+
0,
134+
360,
135+
180,
136+
-180,
137+
720,
138+
]
139+
140+
141+
@pytest.mark.parametrize("angle", test_aladin_float_rotation)
142+
def test_aladin_float_rotation_set(angle: float) -> None:
143+
"""Test setting the rotation of an Aladin object with a float.
144+
145+
Parameters
146+
----------
147+
angle : float
148+
The angle to set.
149+
150+
"""
151+
aladin.rotation = angle
152+
assert aladin.rotation.deg == angle
153+
154+
155+
@pytest.mark.parametrize("angle", test_aladin_float_fov)
156+
def test_aladin_angle_rotation_set(angle: float) -> None:
157+
"""Test setting the rotation of an Aladin object with an Angle object.
158+
159+
Parameters
160+
----------
161+
angle : float
162+
The angle to set.
163+
164+
"""
165+
angle_rotation = Angle(angle, unit="deg")
166+
aladin.rotation = angle_rotation
167+
assert aladin.rotation.deg == angle_rotation.deg
168+
169+
132170
test_stcs_iterables = [
133171
"CIRCLE ICRS 258.93205686 43.13632863 0.625",
134172
[

0 commit comments

Comments
 (0)