1717
1818from ... import mast
1919
20- from ...exceptions import RemoteServiceError
20+ from ...exceptions import RemoteServiceError , NoResultsWarning
2121
2222OBSID = mast .Observations .query_object ("M8" , radius = ".04 deg" )[0 ]['obsid' ]
2323
@@ -642,10 +642,12 @@ def test_tesscut_get_sectors(self):
642642 assert sector_table ['ccd' ][0 ] > 0
643643
644644 # This should always return no results
645- #coord = SkyCoord(90, -66.5, unit="deg")
646- #sector_table = mast.Tesscut.get_sectors(coordinates=coord, radius=0)
647- #assert isinstance(sector_table, Table)
648- #assert len(sector_table) == 0
645+ with pytest .warns (NoResultsWarning ):
646+ coord = SkyCoord (90 , - 66.5 , unit = "deg" )
647+ sector_table = mast .Tesscut .get_sectors (coordinates = coord ,
648+ radius = 0 )
649+ assert isinstance (sector_table , Table )
650+ assert len (sector_table ) == 0
649651
650652 sector_table = mast .Tesscut .get_sectors (objectname = "M104" )
651653 assert isinstance (sector_table , Table )
@@ -734,10 +736,11 @@ def test_zcut_get_surveys(self):
734736 assert survey_list [2 ] == 'goods_north'
735737
736738 # This should always return no results
737- #coord = SkyCoord(57.10523, -30.08085, unit="deg")
738- #survey_list = mast.Zcut.get_surveys(coordinates=coord, radius=0)
739- #assert isinstance(survey_list, list)
740- #assert len(survey_list) == 0
739+ with pytest .warns (NoResultsWarning ):
740+ coord = SkyCoord (57.10523 , - 30.08085 , unit = "deg" )
741+ survey_list = mast .Zcut .get_surveys (coordinates = coord , radius = 0 )
742+ assert isinstance (survey_list , list )
743+ assert len (survey_list ) == 0
741744
742745 def test_zcut_download_cutouts (self , tmpdir ):
743746
@@ -773,12 +776,14 @@ def test_zcut_download_cutouts(self, tmpdir):
773776 for row in cutout_table :
774777 assert os .path .isfile (cutout_table [0 ]['Local Path' ])
775778
776- #cutout_table = mast.Zcut.download_cutouts(coordinates=coord, survey='candels_gn_30mas', cutout_format="jpg", path=str(tmpdir))
777- #assert isinstance(cutout_table, Table)
778- #assert len(cutout_table) == 3
779- #assert cutout_table["Local Path"][0][-4:] == ".jpg"
780- #for row in cutout_table:
781- # assert os.path.isfile(cutout_table[0]['Local Path'])
779+ # Intetionally returns no results
780+ with pytest .warns (NoResultsWarning ):
781+ cutout_table = mast .Zcut .download_cutouts (coordinates = coord ,
782+ survey = 'candels_gn_30mas' ,
783+ cutout_format = "jpg" ,
784+ path = str (tmpdir ))
785+ assert isinstance (cutout_table , Table )
786+ assert len (cutout_table ) == 0
782787
783788 cutout_table = mast .Zcut .download_cutouts (coordinates = coord , cutout_format = "jpg" , path = str (tmpdir ), stretch = 'asinh' , invert = True )
784789 assert isinstance (cutout_table , Table )
@@ -801,7 +806,9 @@ def test_zcut_get_cutouts(self):
801806 assert len (cutout_list ) >= 1
802807 assert isinstance (cutout_list [0 ], fits .HDUList )
803808
804- #cutout_list = mast.Zcut.get_cutouts(coordinates=coord, survey='candels_gn_30mas')
805- #assert isinstance(cutout_list, list)
806- #assert len(cutout_list) == 1
807- #assert isinstance(cutout_list[0], fits.HDUList)
809+ # Intentionally returns no results
810+ with pytest .warns (NoResultsWarning ):
811+ cutout_list = mast .Zcut .get_cutouts (coordinates = coord ,
812+ survey = 'candels_gn_30mas' )
813+ assert isinstance (cutout_list , list )
814+ assert len (cutout_list ) == 0
0 commit comments