From a1c7b95c884e77c699b44235927f1ab550eef83c Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 6 Jul 2019 10:20:17 +0200 Subject: [PATCH] Add test case for missing HiPS tiles --- hips/tiles/tests/test_fetch.py | 20 +++++++++++++++++++- hips/tiles/tile.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hips/tiles/tests/test_fetch.py b/hips/tiles/tests/test_fetch.py index aab47e4..a067e0f 100644 --- a/hips/tiles/tests/test_fetch.py +++ b/hips/tiles/tests/test_fetch.py @@ -1,7 +1,7 @@ # 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 @@ -9,12 +9,27 @@ 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], + ), ] @@ -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) diff --git a/hips/tiles/tile.py b/hips/tiles/tile.py index c29e4a5..cc31dbb 100644 --- a/hips/tiles/tile.py +++ b/hips/tiles/tile.py @@ -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 --------