Skip to content

Commit

Permalink
Correct outputs from order_granules method
Browse files Browse the repository at this point in the history
Adding the start of the stdout message, and expanding the reqparams and orderIDs length to get the integration test to pass.
  • Loading branch information
weiji14 committed Aug 22, 2024
1 parent 58a4a68 commit 97ba3de
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions icepyx/tests/test_behind_NSIDC_API_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,22 @@ def test_download_granules_without_subsetting(reg, session, capsys):

reg.order_granules(verbose=False, subset=False, email=False)
out, err = capsys.readouterr() # capture stdout and stderr
assert out == ""
assert out.startswith(

Check warning on line 65 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#L63-L65

Added lines #L63 - L65 were not covered by tests
"Total number of data order requests is 1 for 3 granules.\n"
"Data request 1 of 1 is submitting to NSIDC\n"
)
assert err == ""

Check warning on line 69 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#L69

Added line #L69 was not covered by tests

assert reg.reqparams == {"short_name": "ATL06", "version": "006", "page_size": 2000}
assert len(reg.granules.orderIDs) == 1
assert reg.reqparams == {

Check warning on line 71 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#L71

Added line #L71 was not covered by tests
"client_string": "icepyx",
"include_meta": "Y",
"page_num": 0,
"page_size": 2000,
"request_mode": "async",
"short_name": "ATL06",
"version": "006",
}
assert len(reg.granules.orderIDs) == 2
assert int(reg.granules.orderIDs[0]) >= 5_000_000_000_000

Check warning on line 81 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#L80-L81

Added lines #L80 - L81 were not covered by tests

reg.download_granules(path=path)

Check warning on line 83 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#L83

Added line #L83 was not covered by tests
Expand Down

0 comments on commit 97ba3de

Please sign in to comment.