Skip to content

Commit

Permalink
small tes fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ceb8 committed Sep 6, 2023
1 parent 1a5a015 commit 6bacfa6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion astroquery/esa/neocc/test/test_neocc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def get_mockreturn(name, timeout=TIMEOUT, verify=VERIFICATION):
fileloc = fileloc.split(r'&')[0] + '.eph'

filename = data_path(fileloc)
content = open(filename, 'rb').read()
with open(filename, 'rb') as FLE:
content = FLE.read()

return MockResponse(content)

Expand Down
8 changes: 5 additions & 3 deletions astroquery/esa/neocc/test/test_neocc_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ def test_tabs_summary(self):
rnd_object = random.choice(self.nea_list["NEA"])

# Request summary and check types
summary = neocc.neocc.query_object(name=rnd_object, tab='summary')
result_list = neocc.neocc.query_object(name=rnd_object, tab='summary')
assert isinstance(result_list, list)
summary = result_list[0]
assert isinstance(summary, Table)
assert 'Discovery Date' in summary.meta.keys()
assert 'Observatory' in summary.meta.keys()
Expand All @@ -518,12 +520,12 @@ def test_tabs_summary(self):
assert all([summary[x].dtype.type == np.str_ for x in summary_cols])

# Check specific asteroids that will remain inmutable
ast_summ1 = neocc.neocc.query_object(name='433', tab='summary')
ast_summ1 = neocc.neocc.query_object(name='433', tab='summary')[0]
assert ast_summ1.meta["Observatory"] == 'Berlin (1835-1913)'
assert ast_summ1.meta["Discovery Date"] == '1898-08-13'

# Check asteroid with no observatory nor discovery date
# This object may change
ast_summ2 = neocc.neocc.query_object(name='2006BV4', tab='summary')
ast_summ2 = neocc.neocc.query_object(name='2006BV4', tab='summary')[0]
assert "Observatory" not in ast_summ2.meta
assert "Discovery Date" not in ast_summ2.meta
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ filterwarnings =
ignore:due to the retirement of its upstream website:astropy.utils.exceptions.AstropyDeprecationWarning
# Leap second update related warning
ignore:leap-second auto-update failed:astropy.utils.exceptions.AstropyWarning

# Temporary for NEOCC
ignore:ERFA function *:erfa.core.ErfaWarning

# Should ignore these for astropy<5.0
ignore:getName|currentThread:DeprecationWarning:astropy
Expand Down

0 comments on commit 6bacfa6

Please sign in to comment.