Skip to content

Commit d13f6aa

Browse files
rickynilssonbsipocz
authored andcommitted
Add more tests. Fix missing +IGNORE_OUTPUT in doc. Fix typo.
1 parent 5b8d3e7 commit d13f6aa

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

astroquery/ipac/nexsci/nasa_exoplanet_archive/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class NasaExoplanetArchiveClass(BaseQuery):
142142
"""
143143

144144
# When module us imported, __init__.py runs and loads a configuration object,
145-
# setting the configuration parameters con.url, conf.timeout and conf.cache
145+
# setting the configuration parameters conf.url, conf.timeout and conf.cache
146146
URL_API = conf.url_api
147147
URL_TAP = conf.url_tap
148148
TIMEOUT = conf.timeout

astroquery/ipac/nexsci/nasa_exoplanet_archive/tests/test_nasa_exoplanet_archive.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from astroquery.exceptions import NoResultsWarning
1616
from astroquery.utils.mocks import MockResponse
17-
from astroquery.ipac.nexsci.nasa_exoplanet_archive.core import NasaExoplanetArchiveClass, conf, InvalidTableError
17+
from astroquery.ipac.nexsci.nasa_exoplanet_archive.core import NasaExoplanetArchiveClass, conf, InvalidTableError, get_access_url
1818
try:
1919
from unittest.mock import Mock, patch, PropertyMock
2020
except ImportError:
@@ -155,6 +155,30 @@ def test_query_aliases(patch_request):
155155
assert '2MASS J05471708-5103594' in result
156156

157157

158+
@pytest.mark.remote_data
159+
def test_query_aliases_planet(patch_request):
160+
nasa_exoplanet_archive = NasaExoplanetArchiveClass()
161+
result = nasa_exoplanet_archive.query_aliases('bet Pic b')
162+
assert len(result) > 10
163+
assert 'GJ 219 b' in result
164+
assert 'bet Pic b' in result
165+
assert '2MASS J05471708-5103594 b' in result
166+
167+
168+
@pytest.mark.remote_data
169+
def test_query_aliases_noresult(patch_request):
170+
nasa_exoplanet_archive = NasaExoplanetArchiveClass()
171+
with pytest.warns(NoResultsWarning):
172+
result = nasa_exoplanet_archive.query_aliases('invalid')
173+
assert len(result) == 0
174+
175+
176+
def test_get_access_url():
177+
assert get_access_url('tap') == conf.url_tap
178+
assert get_access_url('api') == conf.url_api
179+
assert get_access_url('aliaslookup') == conf.url_aliaslookup
180+
181+
158182
def test_backwards_compat(patch_get):
159183
"""
160184
These are the tests from the previous version of this interface.

docs/ipac/nexsci/nasa_exoplanet_archive.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Similarly, cone searches can be executed using the `~astroquery.ipac.nexsci.nasa
5555
>>> from astroquery.ipac.nexsci.nasa_exoplanet_archive import NasaExoplanetArchive
5656
>>> NasaExoplanetArchive.query_region(
5757
... table="pscomppars", coordinates=SkyCoord(ra=172.56 * u.deg, dec=7.59 * u.deg),
58-
... radius=1.0 * u.deg)
58+
... radius=1.0 * u.deg) # doctest: +IGNORE_OUTPUT
5959
<QTable masked=True length=2>
6060
pl_name pl_letter hostname ... htm20 sky_coord
6161
... deg,deg

0 commit comments

Comments
 (0)