Skip to content

Commit

Permalink
Merge pull request #43 from icesat2py/add_tests
Browse files Browse the repository at this point in the history
granule ID (pinging NSIDC) test
  • Loading branch information
JessicaS11 authored Apr 7, 2020
2 parents c52639c + 033a138 commit f727322
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions icepyx/core/is2class.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,7 @@ def latest_version(self):
return max([entry['version_id'] for entry in dset_info['feed']['entry']])


#DevGoal: add a test to ensure that _cust_options is actually populated
#DevGoal: add a test to compare the generated list with an existing [checked] one
#DevGoal: add a test to compare the generated list with an existing [checked] one (right now this is done explicitly for keywords, but not for values)?
#DevGoal: use a mock of this ping to test later functions, such as displaying options and widgets, etc.
def _get_custom_options(self, session):
"""
Expand Down
12 changes: 10 additions & 2 deletions icepyx/tests/test_is2class_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ def test_no_granules_in_search_results():
with pytest.raises(AssertionError, match=ermsg):
ipd.Icesat2Data('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-20'], version='2').avail_granules()

def test_correct_granule_list_returned():
reg_a = ipd.Icesat2Data('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28'], version='2')
reg_a.avail_granules()
obs_grans = [gran['producer_granule_id'] for gran in reg_a.granules]
exp_grans = ['ATL06_20190221121851_08410203_002_01.h5', 'ATL06_20190222010344_08490205_002_01.h5', 'ATL06_20190225121032_09020203_002_01.h5', 'ATL06_20190226005526_09100205_002_01.h5']

assert set(obs_grans) == set(exp_grans)


#CMR temporal and spatial formats --> what's the best way to compare formatted text? character by character comparison of strings?
#check that search results are correct (spatially, temporally, match actually available data)
#add check that correct granules are returned for a search using region_a.granules
#check that search results are correct (spatially, temporally, match actually available data)

0 comments on commit f727322

Please sign in to comment.