Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing ATL14 gridded land ice download from earthdata #289

Open
wants to merge 14 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
- stage: behind Earthdata
script:
- export EARTHDATA_PASSWORD=$NSIDC_LOGIN
- pytest icepyx/tests/test_behind_NSIDC_API_login.py
- pytest --verbose icepyx/tests/test_behind_NSIDC_API_login.py
20 changes: 20 additions & 0 deletions doc/source/user_guide/documentation/classes_dev_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 22 additions & 9 deletions icepyx/tests/test_behind_NSIDC_API_login.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiji14 If I'm understanding this right, we've added ATL14 as part of the fixture, but then don't actually run any tests on it beyond creating a query object with those parameters (in which case, shouldn't we just create a query object with it elsewhere instead of in test_behind_NSIDC_API_login.py). That or the assertions in lines 50-51 will fail because there's no appropriate json file for the ATL14 custom options...

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@
# or is this an NSIDC level test so long as we verify the right info is submitted?


@pytest.fixture(scope="module")
def reg():
live_reg = ipx.Query(
"ATL06", [-55, 68, -48, 71], ["2019-02-22", "2019-02-28"], version="006"
)
yield live_reg
del live_reg
@pytest.fixture(

Check warning on line 16 in icepyx/tests/test_behind_NSIDC_API_login.py

View check run for this annotation

Codecov / codecov/patch

icepyx/tests/test_behind_NSIDC_API_login.py#L16

Added line #L16 was not covered by tests
scope="module",
params=[
dict(
product="ATL14",
spatial_extent=[20, 79, 28, 80],
date_range=["2019-03-29", "2022-03-22"],
version="002",
),
dict(
product="ATL06",
spatial_extent=[-55, 68, -48, 71],
date_range=["2019-02-22", "2019-02-28"],
version="006",
),
],
)
def reg(request):
return ipx.Query(**request.param)

Check warning on line 34 in icepyx/tests/test_behind_NSIDC_API_login.py

View check run for this annotation

Codecov / codecov/patch

icepyx/tests/test_behind_NSIDC_API_login.py#L33-L34

Added lines #L33 - L34 were not covered by tests


@pytest.fixture(scope="module")
Expand All @@ -37,8 +49,9 @@
obs = is2ref._get_custom_options(session, "ATL06", "006")
with open("./icepyx/tests/ATL06v06_options.json") as exp_json:
exp = json.load(exp_json)
assert all(keys in obs.keys() for keys in exp.keys())
assert all(obs[key] == exp[key] for key in exp.keys())
for key in exp.keys():
assert key in obs.keys()
assert exp[key] == obs[key]

Check warning on line 54 in icepyx/tests/test_behind_NSIDC_API_login.py

View check run for this annotation

Codecov / codecov/patch

icepyx/tests/test_behind_NSIDC_API_login.py#L53-L54

Added lines #L53 - L54 were not covered by tests


########## query module ##########
Expand Down