Skip to content

Commit c56a4fe

Browse files
committed
Use a comet that does not fail; Use mocked data for uncertainty tests.
2024 AA does not return uncertainty info anymore. Rather than continuously chase objects with uncertianties, just test mocked data.
1 parent cd91eae commit c56a4fe

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

astroquery/mpc/tests/test_mpc.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,16 @@ def test_get_ephemeris_perturbed(perturbed, val):
383383

384384
@pytest.mark.parametrize('unc_links', (True, False))
385385
def test_get_ephemeris_unc_links(unc_links, patch_post):
386-
tab = mpc.core.MPC.get_ephemeris('1994 XG', unc_links=unc_links)
387-
assert ('Unc. map' in tab.colnames) == unc_links
388-
assert ('Unc. offsets' in tab.colnames) == unc_links
386+
result = mpc.core.MPC.get_ephemeris('1994 XG', unc_links=unc_links)
387+
assert np.all(result['Uncertainty 3sig'].quantity > 0 * u.arcsec)
388+
assert ('Unc. map' in result.colnames) == unc_links
389+
assert ('Unc. offsets' in result.colnames) == unc_links
390+
391+
392+
def test_get_ephemeris_Moon_phase_and_Uncertainty(patch_post):
393+
result = mpc.core.MPC.get_ephemeris('1994 XG', location='G37')
394+
assert np.all(result['Moon phase'][0] >= 0)
395+
assert np.all(result['Uncertainty 3sig'].quantity > 0 * u.arcsec)
389396

390397

391398
def test_get_observatory_codes(patch_get):

astroquery/mpc/tests/test_mpc_remote.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_get_observatory_codes(self):
7272
greenwich = ['000', 0.0, 0.62411, 0.77873, 'Greenwich']
7373
assert all([r == g for r, g in zip(response[0], greenwich)])
7474

75-
@pytest.mark.parametrize('target', ['(3202)', 'C/2003 A2'])
75+
@pytest.mark.parametrize('target', ['(3202)', 'C/2024 N4'])
7676
def test_get_ephemeris_by_target(self, target):
7777
# test that query succeeded
7878
response = mpc.MPC.get_ephemeris(target)
@@ -82,17 +82,6 @@ def test_get_ephemeris_Moon_phase(self):
8282
result = mpc.core.MPC.get_ephemeris('2P', location='G37')
8383
assert result['Moon phase'][0] >= 0
8484

85-
def test_get_ephemeris_Uncertainty(self):
86-
# this test requires an object with uncertainties != N/A
87-
result = mpc.core.MPC.get_ephemeris('2024 AA', start='2024-06-15')
88-
assert result['Uncertainty 3sig'].quantity[0] > 0 * u.arcsec
89-
90-
def test_get_ephemeris_Moon_phase_and_Uncertainty(self):
91-
# this test requires an object with uncertainties != N/A
92-
result = mpc.core.MPC.get_ephemeris('2024 AA', location='G37', start='2024-06-15')
93-
assert result['Moon phase'][0] >= 0
94-
assert result['Uncertainty 3sig'].quantity[0] > 0 * u.arcsec
95-
9685
def test_get_ephemeris_target_fail(self):
9786
# test that query failed
9887
with pytest.raises(InvalidQueryError):

0 commit comments

Comments
 (0)