Skip to content

Commit e92f323

Browse files
committed
adding suggested init testing
1 parent c72e087 commit e92f323

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

src/tests/test_aladin.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_aladin_float_rotation_set(angle: float) -> None:
152152
assert aladin.rotation.deg == angle
153153

154154

155-
@pytest.mark.parametrize("angle", test_aladin_float_fov)
155+
@pytest.mark.parametrize("angle", test_aladin_float_rotation)
156156
def test_aladin_angle_rotation_set(angle: float) -> None:
157157
"""Test setting the rotation of an Aladin object with an Angle object.
158158
@@ -167,6 +167,51 @@ def test_aladin_angle_rotation_set(angle: float) -> None:
167167
assert aladin.rotation.deg == angle_rotation.deg
168168

169169

170+
@pytest.mark.parametrize("angle", test_aladin_float_rotation)
171+
def test_aladin_init_rotation(angle: float) -> None:
172+
"""Test initializing an Aladin object with rotation set.
173+
174+
Parameters
175+
----------
176+
angle : float
177+
The angle to set.
178+
179+
"""
180+
test_aladin = Aladin(rotation=angle)
181+
assert test_aladin.rotation.deg == angle
182+
183+
184+
@pytest.mark.parametrize("angle", test_aladin_float_rotation)
185+
def test_aladin_init_north_pole_orientation(angle: float) -> None:
186+
"""Test initializing Aladin object with north_pole_orientation set.
187+
188+
Parameters
189+
----------
190+
angle : float
191+
The angle to set.
192+
193+
"""
194+
test_aladin = Aladin(north_pole_orientation=angle)
195+
assert test_aladin.rotation.deg == angle
196+
197+
198+
@pytest.mark.parametrize("angle", test_aladin_float_rotation)
199+
def test_aladin_init_north_pole_orientation_overrides_rotation(angle: float) -> None:
200+
"""
201+
Test init Aladin object with north_pole_orientation and rotation set.
202+
203+
north_pole_orientation should override rotation.
204+
205+
Parameters
206+
----------
207+
angle : float
208+
The angle to set.
209+
210+
"""
211+
test_aladin = Aladin(north_pole_orientation=angle, rotation=180)
212+
assert test_aladin.rotation.deg == angle
213+
214+
170215
test_stcs_iterables = [
171216
"CIRCLE ICRS 258.93205686 43.13632863 0.625",
172217
[

0 commit comments

Comments
 (0)