Skip to content

Commit

Permalink
Add test case for missing HiPS tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
adl1995 committed Jul 6, 2019
1 parent f235ae9 commit a1c7b95
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion hips/tiles/tests/test_fetch.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.tests.helper import remote_data
from numpy.testing import assert_allclose
from numpy.testing import assert_allclose, assert_equal
from ..fetch import fetch_tiles
from ..survey import HipsSurveyProperties
from ..tile import HipsTileMeta

TILE_FETCH_TEST_CASES = [
dict(
tile_indices=[69623, 69627, 69628, 69629, 69630, 69631],
is_missing=[False, False, False, False, False, False],
tile_format='fits',
order=7,
url='http://alasky.unistra.fr/DSS/DSS2Merged/properties',
progress_bar=True,
data=[2101, 1945, 1828, 1871, 2079, 2336],
),
dict(
tile_indices=[69623,
9999999, # missing
69628,
9999999, # missing
9999999, # missing
69631],
is_missing=[False, True, False, True, True, False],
tile_format='fits',
order=7,
url='http://alasky.unistra.fr/DSS/DSS2Merged/properties',
progress_bar=True,
data=[2101, 0, 1828, 0, 0, 2336],
),
]


Expand Down Expand Up @@ -42,3 +57,6 @@ def test_fetch_tiles(pars):

for idx, val in enumerate(pars['data']):
assert_allclose(tiles[idx].data[0][5], val)

for idx, val in enumerate(pars['is_missing']):
assert_equal(tiles[idx].is_missing, val)
2 changes: 1 addition & 1 deletion hips/tiles/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class HipsTile:
raw_data : `bytes`
Raw data (copy of bytes from file)
is_missing : `bool`
To check whether the tile is missing or not
Specifies whether the tile is missing or not
Examples
--------
Expand Down

0 comments on commit a1c7b95

Please sign in to comment.