Skip to content
Open
Show file tree
Hide file tree
Changes from 13 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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ stages:
jobs:
include:
- stage: basic tests
script: pytest icepyx/ --verbose --cov app --ignore icepyx/tests/test_behind_NSIDC_API_login.py
script: pytest --verbose icepyx/ --cov app --ignore icepyx/tests/test_behind_NSIDC_API_login.py
after_success: codecov/codecov-action@v3

- stage: behind Earthdata
script:
- export NSIDC_LOGIN=$NSIDC_LOGIN
- pytest icepyx/tests/test_behind_NSIDC_API_login.py
- pytest --verbose icepyx/tests/test_behind_NSIDC_API_login.py
2 changes: 1 addition & 1 deletion 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.
1 change: 0 additions & 1 deletion icepyx/tests/ATL06v05_options.json

This file was deleted.

1 change: 1 addition & 0 deletions icepyx/tests/ATL06v06_options.json
Comment thread
JessicaS11 marked this conversation as resolved.

Large diffs are not rendered by default.

35 changes: 24 additions & 11 deletions icepyx/tests/test_behind_NSIDC_API_login.py

Copy link
Copy Markdown
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 @@ -9,13 +9,25 @@
# check that downloaded data is subset? 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="005"
)
yield live_reg
del live_reg
@pytest.fixture(
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)


@pytest.fixture(scope="module")
Expand All @@ -31,11 +43,12 @@ def session(reg):


def test_get_custom_options_output(session):
obs = is2ref._get_custom_options(session, "ATL06", "005")
with open("./icepyx/tests/ATL06v05_options.json") as exp_json:
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]


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