@@ -157,20 +157,30 @@ def test_set_get_viewport_errors(self, data, wcs):
157157 with pytest .raises (ValueError , match = '[Ii]mage label.*not provided' ):
158158 self .image .get_viewport ()
159159
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.
165163 self .image .load_image (data )
166164
167165 # Getting the viewport should not fail...
168166 vport = self .image .get_viewport ()
167+
169168 assert 'center' in vport
169+ # No world, so center should be a tuple
170+ assert isinstance (vport ['center' ], tuple )
170171 assert 'fov' in vport
172+ # fov should be a float since no WCS
173+ assert isinstance (vport ['fov' ], float )
171174 assert 'image_label' in vport
172175 assert vport ['image_label' ] is None
173176
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+
174184 # Set the viewport without an image label
175185 self .image .set_viewport (center = (10 , 10 ), fov = 100 )
176186
0 commit comments