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
13+ from astropy .table import Table , unique
14+ from requests .models import Response
1615
17- from astroquery .mast import Observations , utils , Mast , Catalogs , Hapcut , Tesscut , Zcut , MastMissions
16+ from astroquery .mast import ( Catalogs , Hapcut , Mast , MastMissions , Observations , Tesscut , Zcut , utils )
1817
18+ from ...exceptions import (InputWarning , InvalidQueryError , MaxResultsWarning , NoResultsWarning )
1919from ..utils import ResolverError
20- from ...exceptions import (InputWarning , InvalidQueryError , MaxResultsWarning ,
21- NoResultsWarning )
2220
2321
2422@pytest .fixture (scope = "module" )
@@ -66,8 +64,10 @@ def test_resolve_object(self):
6664
6765 # Try the same object with different resolvers
6866 # 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
67+ # TODO: Commenting out NED resolver test for now since we've been having issues with NED service availability.
68+ # Re-enable this test once the service is stable.
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
7171
7272 simbad_loc = utils .resolve_object ("jw100" , resolver = "simbad" )
7373 assert round (simbad_loc .separation (SkyCoord ("83.70341477 -5.55918309" , unit = "deg" )).value , 4 ) == 0
@@ -79,16 +79,16 @@ def test_resolve_object(self):
7979 # Use resolve_all to get all resolvers
8080 loc_dict = utils .resolve_object ("jw100" , resolve_all = True )
8181 assert isinstance (loc_dict , dict )
82- assert loc_dict ['NED' ] == ned_loc
82+ # assert loc_dict['NED'] == ned_loc
8383 assert loc_dict ['SIMBAD' ] == simbad_loc
8484
8585 # Error if coordinates cannot be resolved
8686 with pytest .raises (ResolverError , match = 'Could not resolve "invalid" to a sky position.' ):
8787 utils .resolve_object ("invalid" )
8888
8989 # 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 " )
90+ with pytest .raises (ResolverError , match = 'not resolve "invalid" to a sky position using resolver "SIMBAD "' ):
91+ utils .resolve_object ("invalid" , resolver = "SIMBAD " )
9292
9393 ###########################
9494 # MissionSearchClass Test #
0 commit comments