@@ -157,20 +157,30 @@ def test_set_get_viewport_errors(self, data, wcs):
157
157
with pytest .raises (ValueError , match = '[Ii]mage label.*not provided' ):
158
158
self .image .get_viewport ()
159
159
160
- def test_set_get_view_port_no_image_label (self , data ):
161
- # If there is only one image, the viewport should be able to be set
162
- # and retrieved without an image label.
163
-
164
- # Add an image without an image label
160
+ def test_viewport_is_defined_aster_loading_image (self , data ):
161
+ # Check that the viewport is set to a default value when an image
162
+ # is loaded, even if no viewport is explicitly set.
165
163
self .image .load_image (data )
166
164
167
165
# Getting the viewport should not fail...
168
166
vport = self .image .get_viewport ()
167
+
169
168
assert 'center' in vport
169
+ # No world, so center should be a tuple
170
+ assert isinstance (vport ['center' ], tuple )
170
171
assert 'fov' in vport
172
+ # fov should be a float since no WCS
173
+ assert isinstance (vport ['fov' ], float )
171
174
assert 'image_label' in vport
172
175
assert vport ['image_label' ] is None
173
176
177
+ def test_set_get_view_port_no_image_label (self , data ):
178
+ # If there is only one image, the viewport should be able to be set
179
+ # and retrieved without an image label.
180
+
181
+ # Add an image without an image label
182
+ self .image .load_image (data )
183
+
174
184
# Set the viewport without an image label
175
185
self .image .set_viewport (center = (10 , 10 ), fov = 100 )
176
186
0 commit comments