11# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
3+ import json
34import logging
5+ import os
46from pathlib import Path
7+
8+ import astropy .units as u
59import numpy as np
6- import os
710import pytest
8- import json
9-
10- from requests .models import Response
11-
12- from astropy .table import Table , unique
1311from astropy .coordinates import SkyCoord
1412from astropy .io import fits
15- import astropy .units as u
16-
17- from astroquery .mast import Observations , utils , Mast , Catalogs , Hapcut , Tesscut , Zcut , MastMissions
13+ from astropy .table import Table , unique
14+ from requests .models import Response
1815
16+ from astroquery .mast import (
17+ Catalogs ,
18+ Hapcut ,
19+ Mast ,
20+ MastMissions ,
21+ Observations ,
22+ Tesscut ,
23+ Zcut ,
24+ utils ,
25+ )
26+
27+ from ...exceptions import (
28+ InputWarning ,
29+ InvalidQueryError ,
30+ MaxResultsWarning ,
31+ NoResultsWarning ,
32+ )
1933from ..utils import ResolverError
20- from ...exceptions import (InputWarning , InvalidQueryError , MaxResultsWarning ,
21- NoResultsWarning )
2234
2335
2436@pytest .fixture (scope = "module" )
@@ -66,8 +78,10 @@ def test_resolve_object(self):
6678
6779 # Try the same object with different resolvers
6880 # The position of objects can change with different resolvers
69- ned_loc = utils .resolve_object ("jw100" , resolver = "NED" )
70- assert round (ned_loc .separation (SkyCoord ("354.10436 21.15083" , unit = 'deg' )).value , 4 ) == 0
81+ # TODO: Commenting out NED resolver test for now since we've been having issues with NED service availability.
82+ # Re-enable this test once the service is stable.
83+ # ned_loc = utils.resolve_object("jw100", resolver="NED")
84+ # assert round(ned_loc.separation(SkyCoord("354.10436 21.15083", unit='deg')).value, 4) == 0
7185
7286 simbad_loc = utils .resolve_object ("jw100" , resolver = "simbad" )
7387 assert round (simbad_loc .separation (SkyCoord ("83.70341477 -5.55918309" , unit = "deg" )).value , 4 ) == 0
@@ -79,16 +93,16 @@ def test_resolve_object(self):
7993 # Use resolve_all to get all resolvers
8094 loc_dict = utils .resolve_object ("jw100" , resolve_all = True )
8195 assert isinstance (loc_dict , dict )
82- assert loc_dict ['NED' ] == ned_loc
96+ # assert loc_dict['NED'] == ned_loc
8397 assert loc_dict ['SIMBAD' ] == simbad_loc
8498
8599 # Error if coordinates cannot be resolved
86100 with pytest .raises (ResolverError , match = 'Could not resolve "invalid" to a sky position.' ):
87101 utils .resolve_object ("invalid" )
88102
89103 # Error if coordinates cannot be resolved with a specific resolver
90- with pytest .raises (ResolverError , match = 'Could not resolve "invalid" to a sky position using resolver "NED "' ):
91- utils .resolve_object ("invalid" , resolver = "NED " )
104+ with pytest .raises (ResolverError , match = 'not resolve "invalid" to a sky position using resolver "SIMBAD "' ):
105+ utils .resolve_object ("invalid" , resolver = "SIMBAD " )
92106
93107 ###########################
94108 # MissionSearchClass Test #
0 commit comments