@@ -298,6 +298,31 @@ def test_list_coordinates(patch_request, dr, radius, width):
298
298
url_tester (dr )
299
299
300
300
301
+ @pytest .mark .parametrize ("width" , [Angle ('2 arcsec' ), 2.0 * u .arcsec , '2.0 arcsec' , 'bad angle' ])
302
+ @pytest .mark .parametrize ("height" , [None , Angle ('2 arcsec' ), 2.0 * u .arcsec , '2.0 arcsec' , 'bad angle' ])
303
+ def test_list_coordinates_with_height (patch_request , width , height ):
304
+ if width == 'bad angle' or height == 'bad angle' :
305
+ with pytest .raises (TypeError ) as e :
306
+ sdss .SDSS .query_region (coords , width = width , height = height )
307
+ if width == 'bad angle' :
308
+ assert str (e .value ) == "width should be either Quantity or convertible to float."
309
+ else :
310
+ assert str (e .value ) == "height should be either Quantity or convertible to float."
311
+ else :
312
+ xid = sdss .SDSS .query_region (coords_list , width = width , height = height )
313
+
314
+ with warnings .catch_warnings ():
315
+ if sys .platform .startswith ('win' ):
316
+ warnings .filterwarnings ("ignore" , category = AstropyWarning ,
317
+ message = r'OverflowError converting.*' )
318
+ data = Table .read (data_path (DATA_FILES ['images_id' ]),
319
+ format = 'ascii.csv' , comment = '#' )
320
+
321
+ data ['objid' ] = data ['objid' ].astype (np .int64 )
322
+
323
+ compare_xid_data (xid , data )
324
+
325
+
301
326
@pytest .mark .parametrize ("dr" , dr_list )
302
327
def test_column_coordinates (patch_request , dr ):
303
328
xid = sdss .SDSS .query_region (coords_column , radius = Angle ('2 arcsec' ), data_release = dr )
0 commit comments