-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* S2_query_roi() supports the `spatial` parameter as S2_query_granule() * Many small fixes to S2_buy_granule() * S2_do_query() casts result to dplyr's tibble if the dplyr package is available * S2_put_ROI() renamed to S2_put_roi() and now returns already parsed REST API response * More tests
- Loading branch information
Showing
12 changed files
with
170 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ Imports: | |
Suggests: | ||
testthat, | ||
covr, | ||
dplyr, | ||
knitr, | ||
rmarkdown, | ||
sf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
context('buying') | ||
|
||
test_that('S2_buy_granule() works', { | ||
granules = S2_query_granule(owned = TRUE) | ||
|
||
expect_equal(S2_buy_granule(granules$granuleId[1:2], 'always'), c(FALSE, FALSE)) | ||
|
||
expect_equal(S2_buy_granule(granules$granuleId[1:2], 'force'), c(TRUE, TRUE)) | ||
|
||
expect_error(S2_buy_granule(1, 'always'), 'Please check coin budget') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
context('put roi') | ||
|
||
test_that('S2_put_roi() works', { | ||
ret = S2_put_roi('{"type": "Polygon", "coordinates": [[[16.5, 48.0], [16.6, 48.1], [16.6, 48.0], [16.5, 48.0]]]}', '__test__', 0, 'LAI', '1900-01-01', '1900-01-02') | ||
expect_equal(ret, list(userId = 'test@s2.boku.eodc.eu', regionId = '__test__')) | ||
d = S2_query_roi(regionId = '__test__') | ||
expect_equal(nrow(d), 1) | ||
expect_equal(d$dateMax, '1900-01-02') | ||
|
||
ret = S2_put_roi('{"type": "Polygon", "coordinates": [[[16.5, 48.0], [16.6, 48.1], [16.6, 48.0], [16.5, 48.0]]]}', '__test__', 0, 'LAI', '1900-01-01', '1900-02-02') | ||
expect_equal(ret, list(userId = 'test@s2.boku.eodc.eu', regionId = '__test__')) | ||
d = S2_query_roi(regionId = '__test__') | ||
expect_equal(nrow(d), 1) | ||
expect_equal(d$dateMax, '1900-02-02') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters